Billings

A service which allows to manage tariffs, billing automation and Xero integration.

Get default events

Show default events for tariff

GET /billing-service/tariff/default_events
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
Example Response
{
    "result": {
        "events": [
            {
                "event": 2,
                "name": "Widget Link Click",
                "description": "Website, phone or email clicks"
            },
            {
                "event": 3,
                "name": "Social Media",
                "description": "Social media link clicks"
            },
            {
                "event": 4,
                "name": "Featured products",
                "description": "Featured products clicks"
            },
            {
                "event": 5,
                "name": "Cross-marketing",
                "description": "Cross-marketing widget"
            },
            {
                "event": 6,
                "name": "Click2scan",
                "description": "-"
            },
            {
                "event": 7,
                "name": "GDTI",
                "description": "GDTI Clicks"
            },
            {
                "event": 40,
                "name": "Campaign Setup",
                "description": "Fee for campaign setup"
            },
            {
                "event": 41,
                "name": "Cashback transaction fee",
                "description": "Cashback transaction fee"
            },
            {
                "event": 44,
                "name": "Cashback handling fee",
                "description": "Cashback handling fee"
            }
        ],
        "custom_events": [
            {
                "event": 0,
                "name": "Custom event",
                "description": "Custom event description"
            }
        ]
    }
}

List participant tariffs

Show participant doc with all tariffs

GET /billing-service/tariff/:participant
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
participant params Required: Participant (urn format)
Example req
GET '/billing-service/tariff/urn:authenticateit:participant:1'
Example Response
{
  "value": {
    "_id": "urn:authenticateit:participant:1@tariffs",
    "tariffs": [
      {
        "id": "ffb7c613-4b18-40fe-aa9d-afa28f5ec401",
        "starts_at": "2022-01-01T00:00:00.000Z",
        "created_at": "2021-12-20T12:30:10.532Z",
        "updated_at": "2021-12-20T12:32:12.132Z",
        "events": [
          {
            "event": 2,
            "value": 0.3
          },
          {
            "event": 3,
            "value": 0.3
          },
          {
            "event": 5,
            "value": 0.3
          },
          {
            "event": 7,
            "value": 0.3
          },
          {
            "event": 10,
            "value": 0.4
          },
          {
            "event": 11,
            "value": 0.35
          },
          {
            "event": 12,
            "value": 0.3
          },
          {
            "event": 15,
            "value": 0.03
          },
          {
            "event": 16,
            "value": 0.03
          },
          {
            "event": 17,
            "value": 0.03
          },
          {
            "event": 44,
            "cashback_transaction_fee": 0.45,
            "handling_fee": 0.3
          }
        ]
      },
      {
        "id": "aa9f6310-03c2-43a2-a138-175e908de745",
        "created_at": "2021-12-20T18:30:55.632Z",
        "updated_at": "2021-12-20T19:02:27.304Z",
        "starts_at": "2021-10-20T17:40:43.788Z",
        "events": [
          {
            "event": 44,
            "cashback_transaction_fee": 1.1,
            "handling_fee": 0.3
          },
          {
            "event": 13,
            "value": 0.5
          }
        ]
      }
    ],
    "type": "participant_tariffs"
  }
}

Get participant tariff

Shows exact participant tariff

GET /billing-service/tariff/:participant/:tariff_id
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
participant params Required: Participant (urn format)
tariff_id params Required: Tariff id (uuid)
Example req
GET '/billing-service/tariff/urn:authenticateit:participant:1/ffb7c613-4b18-40fe-aa9d-afa28f5ec401'
Example Response
{
  "value": {
    "id": "ffb7c613-4b18-40fe-aa9d-afa28f5ec401",
    "starts_at": "2022-01-01T00:00:00.000Z",
    "created_at": "2021-12-20T12:30:10.532Z",
    "updated_at": "2021-12-20T12:32:12.132Z",
    "events": [
      {
        "event": 2,
        "value": 0.3
      },
      {
        "event": 3,
        "value": 0.3
      },
      {
        "event": 5,
        "value": 0.3
      },
      {
        "event": 7,
        "value": 0.3
      },
      {
        "event": 10,
        "value": 0.4
      },
      {
        "event": 11,
        "value": 0.35
      },
      {
        "event": 12,
        "value": 0.3
      },
      {
        "event": 15,
        "value": 0.03
      },
      {
        "event": 16,
        "value": 0.03
      },
      {
        "event": 17,
        "value": 0.03
      },
      {
        "event": 44,
        "cashback_transaction_fee": 0.45,
        "handling_fee": 0.3
      }
    ]
  }
}

Create participant tariff

Create new participant tariff

POST /billing-service/tariff/:participant
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
participant params Required: Participant (urn format)
starts_at body Required: Date when new tariff starts (ISO Format)
events body Optional: Array of objects
custom_events body Optional: Array of objects
Events structure
events: [
    {
        event:  number, required
        value: number
        cashback_transaction_fee: number
        handling_fee: number
    }
]
Custom events structure
"custom_events": [
  {
      "event": number, required (allways 0)
      "value": number,
      "cashback_transaction_fee": number,
      "handling_fee": number,
      "name": string, required
      "description": string,
      "frequency": string, required
  }
]
Example req body
{
    "starts_at": "2021-12-20T17:40:43.788Z",
    "events": [
        {
            "event": 44,
            "cashback_transaction_fee": 1.1,
            "handling_fee": 0.3
        },
        {
            "event": 13,
            "value": 0.5
        }
    ],
    "custom_events": [
        {
            "event": 0,
            "value": 4,
            "handling_fee": 1,
            "name": "Test custom event",
            "description": "Test custom event description",
            "frequency": "SINGLE"
        }
    ]
}
Example Response
{
  "value": {
    "id": "2dbe7901-9dbb-4a0f-bae5-e8f5ecf7f37f",
    "created_at": "2021-12-21T15:34:45.526Z",
    "updated_at": "2021-12-21T15:34:45.526Z",
    "starts_at": "2021-12-20T17:40:43.788Z",
    "events": [
      {
        "event": 44,
        "cashback_transaction_fee": 1.1,
        "handling_fee": 0.3
      },
      {
        "event": 13,
        "value": 0.5
      }
    ],
    "custom_events": [
      {
          "event": 0,
          "value": 4,
          "handling_fee": 1,
          "name": "Test custom event",
          "description": "Test custom event description",
          "frequency": "SINGLE",
          "invoice": "Scheduled",
          "ts": 1689541773498
      }
    ]
  }
}

Update participant tariff

Updates participant tariff

PATCH /billing-service/tariff/:participant/:tariff_id
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
participant params Required: Participant (urn format)
tariff_id params Required: Tariff id (uuid)
starts_at body Optional: Date when new tariff starts (ISO Format)
events body Optional: Array of objects
custom_events body Optional: Array of objects
Events structure
events: [
    {
        event:  number, required
        value: number
        cashback_transaction_fee: number
        handling_fee: number
    }
]
Custom events structure
"custom_events": [
  {
      "event": number, required (allways 0)
      "value": number,
      "cashback_transaction_fee": number,
      "handling_fee": number,
      "name": string, required
      "description": string,
      "frequency": string, required
  }
]
Example req body
{
    "events": [
        {
            "event": 44,
            "cashback_transaction_fee": 1.1,
            "handling_fee": 0.3
        },
        {
            "event": 13,
            "value": 0.5
        }
    ],
    "custom_events": [
        {
            "event": 0,
            "value": 4,
            "handling_fee": 1,
            "name": "Test custom event",
            "description": "Test custom event description",
            "frequency": "SINGLE"
        }
    ]
}
Example Response
{
  "value": {
    "id": "aa9f6310-03c2-43a2-a138-175e908de745",
    "created_at": "2021-12-20T18:30:55.632Z",
    "updated_at": "2021-12-21T15:44:33.875Z",
    "starts_at": "2021-10-20T17:40:43.788Z",
    "events": [
      {
        "event": 44,
        "cashback_transaction_fee": 1.1,
        "handling_fee": 0.3
      },
      {
        "event": 13,
        "value": 0.5
      }
    ],
    "custom_events": [
      {
          "event": 0,
          "value": 4,
          "handling_fee": 1,
          "name": "Test custom event",
          "description": "Test custom event description",
          "frequency": "SINGLE",
          "invoice": "Scheduled",
          "ts": 1689541773498
      }
    ]
  }
}

Delete participant tariff

Removes participant tariff from doc.

DELETE /billing-service/tariff/:participant/:tariff_id
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
participant params Required: Participant (urn format)
tariff_id params Required: Tariff id (uuid)
Example req
GET '/billing-service/tariff/urn:authenticateit:participant:1/aa9f6310-03c2-43a2-a138-175e908de745'
Example Response
{
  "value": {
    "_id": "urn:authenticateit:participant:1@tariffs",
    "tariffs": [
      {
        "id": "ffb7c613-4b18-40fe-aa9d-afa28f5ec401",
        "starts_at": "2022-01-01T00:00:00.000Z",
        "created_at": "2021-12-20T12:30:10.532Z",
        "updated_at": "2021-12-20T12:32:12.132Z",
        "events": [
          {
            "event": 2,
            "value": 0.3
          },
          {
            "event": 3,
            "value": 0.3
          },
          {
            "event": 5,
            "value": 0.3
          },
          {
            "event": 7,
            "value": 0.3
          },
          {
            "event": 10,
            "value": 0.4
          },
          {
            "event": 11,
            "value": 0.35
          },
          {
            "event": 12,
            "value": 0.3
          },
          {
            "event": 15,
            "value": 0.03
          },
          {
            "event": 16,
            "value": 0.03
          },
          {
            "event": 17,
            "value": 0.03
          },
          {
            "event": 44,
            "cashback_transaction_fee": 0.45,
            "handling_fee": 0.3
          }
        ]
      },
      {
        "id": "aa9f6310-03c2-43a2-a138-175e908de745",
        "created_at": "2021-12-20T18:30:55.632Z",
        "updated_at": "2021-12-21T15:46:11.383Z",
        "starts_at": "2021-10-20T17:40:43.788Z",
        "events": [
          {
            "event": 44,
            "cashback_transaction_fee": 1.1,
            "handling_fee": 0.3
          },
          {
            "event": 13,
            "value": 0.5
          }
        ]
      },
      {
        "id": "2dbe7901-9dbb-4a0f-bae5-e8f5ecf7f37f",
        "created_at": "2021-12-21T15:34:45.526Z",
        "updated_at": "2021-12-21T15:34:45.526Z",
        "starts_at": "2021-12-20T17:40:43.788Z",
        "events": [
          {
            "event": 44,
            "cashback_transaction_fee": 1.1,
            "handling_fee": 0.3
          },
          {
            "event": 13,
            "value": 0.5
          }
        ]
      }
    ],
    "type": "participant_tariffs"
  }
}

List companies accounts

Get list of companies which have contact in XERO

GET /billing-service/billing/company
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
attention_name query Optional: Name in XERO (used for invoice name)
name query Optional: Participant name
page query Optional: pagination (100 companies in 1 page)
Example req
GET '/billing-service/billing/company'
Example Response
{
  "result": [
    {
      "id": "urn:authenticateit:participant:000007730166315",
      "contact": {
        "contactID": "7484c2c7-d440-4efd-b515-55c43b49916a",
        "accountNumber": "000007730166315",
        "contactStatus": "ACTIVE",
        "name": "test",
        "emailAddress": "",
        "contactPersons": [],
        "bankAccountDetails": "",
        "addresses": [
          {
            "addressType": "STREET",
            "city": "",
            "region": "",
            "postalCode": "",
            "country": "au"
          },
          {
            "addressType": "POBOX",
            "city": "",
            "region": "",
            "postalCode": "",
            "country": "au"
          }
        ],
        "phones": [
          {
            "phoneType": "DDI",
            "phoneNumber": "",
            "phoneAreaCode": "",
            "phoneCountryCode": ""
          },
          {
            "phoneType": "DEFAULT",
            "phoneNumber": "",
            "phoneAreaCode": "",
            "phoneCountryCode": ""
          },
          {
            "phoneType": "FAX",
            "phoneNumber": "",
            "phoneAreaCode": "",
            "phoneCountryCode": ""
          },
          {
            "phoneType": "MOBILE",
            "phoneNumber": "",
            "phoneAreaCode": "",
            "phoneCountryCode": ""
          }
        ],
        "isSupplier": false,
        "isCustomer": false,
        "updatedDateUTC": "2022-02-01T10:56:57.587Z",
        "contactGroups": [],
        "hasAttachments": false,
        "hasValidationErrors": false
      },
      "billings": {},
      "type": "participant"
    },
    {
      "id": "urn:authenticateit:participant:708023102856412",
      "contact": {
        "contactID": "8f6eb941-476d-4da8-b498-8d864347b2d6",
        "accountNumber": "708023102856412",
        "contactStatus": "ACTIVE",
        "name": "Wild Co Test",
        "emailAddress": "email@mail.com",
        "contactPersons": [],
        "bankAccountDetails": "",
        "addresses": [
          {
            "addressType": "STREET",
            "addressLine1": "415 St. Georges Rd.",
            "addressLine2": "Office 30",
            "city": "",
            "region": "VIC",
            "postalCode": "3030",
            "country": "au",
            "attentionTo": "name"
          },
          {
            "addressType": "POBOX",
            "addressLine1": "415 St. Georges Rd.",
            "addressLine2": "Office 30",
            "city": "",
            "region": "VIC",
            "postalCode": "3030",
            "country": "au",
            "attentionTo": "name"
          }
        ],
        "phones": [
          {
            "phoneType": "DDI",
            "phoneNumber": "",
            "phoneAreaCode": "",
            "phoneCountryCode": ""
          },
          {
            "phoneType": "DEFAULT",
            "phoneNumber": "",
            "phoneAreaCode": "",
            "phoneCountryCode": ""
          },
          {
            "phoneType": "FAX",
            "phoneNumber": "",
            "phoneAreaCode": "",
            "phoneCountryCode": ""
          },
          {
            "phoneType": "MOBILE",
            "phoneNumber": "",
            "phoneAreaCode": "",
            "phoneCountryCode": ""
          }
        ],
        "isSupplier": false,
        "isCustomer": true,
        "updatedDateUTC": "2022-02-02T10:16:48.297Z",
        "contactGroups": [],
        "hasAttachments": false,
        "hasValidationErrors": false
      },
      "billings": {
        "frequency": "MONTHLY",
        "due_date": "WEEK",
        "invoice_time": "09:00",
        "has_budget_adjustment": true,
        "has_brand_segmentation": false,
        "exclude_items_with_missing_brand": false,
        "xero_contact_id": "8f6eb941-476d-4da8-b498-8d864347b2d6"
      },
      "budget": 10500,
      "type": "participant"
    },
    {
      "id": "urn:authenticateit:participant:1",
      "contact": {
        "contactID": "09cac7e4-da18-419e-9f78-01eb154c0caa",
        "accountNumber": "1",
        "contactStatus": "ACTIVE",
        "name": "test name",
        "emailAddress": "mail@mail.com",
        "contactPersons": [],
        "bankAccountDetails": "",
        "addresses": [
          {
            "addressType": "STREET",
            "addressLine1": "Plummer St",
            "addressLine2": "test2",
            "city": "",
            "region": "VIC",
            "postalCode": "574",
            "country": "au",
            "attentionTo": "Emma Quirk"
          },
          {
            "addressType": "POBOX",
            "addressLine1": "Plummer St",
            "addressLine2": "test2",
            "city": "",
            "region": "VIC",
            "postalCode": "574",
            "country": "au",
            "attentionTo": "Emma Quirk"
          }
        ],
        "phones": [
          {
            "phoneType": "DDI",
            "phoneNumber": "",
            "phoneAreaCode": "",
            "phoneCountryCode": ""
          },
          {
            "phoneType": "DEFAULT",
            "phoneNumber": "",
            "phoneAreaCode": "",
            "phoneCountryCode": ""
          },
          {
            "phoneType": "FAX",
            "phoneNumber": "",
            "phoneAreaCode": "",
            "phoneCountryCode": ""
          },
          {
            "phoneType": "MOBILE",
            "phoneNumber": "",
            "phoneAreaCode": "",
            "phoneCountryCode": ""
          }
        ],
        "isSupplier": true,
        "isCustomer": true,
        "updatedDateUTC": "2022-02-02T10:29:49.417Z",
        "contactGroups": [],
        "balances": {
          "accountsReceivable": {
            "outstanding": 36.3,
            "overdue": 0
          },
          "accountsPayable": {
            "outstanding": 24.2,
            "overdue": 0
          }
        },
        "hasAttachments": false,
        "hasValidationErrors": false
      },
      "billings": {
        "due_date": "WEEK",
        "frequency": "ANNUALLY",
        "has_brand_segmentation": false,
        "has_budget_adjustment": true,
        "exclude_items_with_missing_brand": false,
        "invoice_time": "14:00",
        "ref_prefix": "test",
        "xero_contact_id": "09cac7e4-da18-419e-9f78-01eb154c0caa"
      },
      "budget": 11,
      "type": "participant"
    }
  ],
  "items": 3
}

Get company account

Get company account by company id

GET /billing-service/billing/company/:company_id
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
company_id params Required: Company_id (participant id)
Example req
GET 'https://dev-api.shping.com/billing-service/billing/company/urn:authenticateit:participant:1'
Example Response
{
  "id": "urn:authenticateit:participant:1",
  "contact": {
    "contactID": "09cac7e4-da18-419e-9f78-01eb154c0caa",
    "accountNumber": "1",
    "contactStatus": "ACTIVE",
    "name": "test name",
    "emailAddress": "mail@mail.com",
    "contactPersons": [],
    "bankAccountDetails": "",
    "addresses": [
      {
        "addressType": "STREET",
        "addressLine1": "Plummer St",
        "addressLine2": "test2",
        "city": "",
        "region": "VIC",
        "postalCode": "574",
        "country": "au",
        "attentionTo": "Emma Quirk"
      },
      {
        "addressType": "POBOX",
        "addressLine1": "Plummer St",
        "addressLine2": "test2",
        "city": "",
        "region": "VIC",
        "postalCode": "574",
        "country": "au",
        "attentionTo": "Emma Quirk"
      }
    ],
    "phones": [
      {
        "phoneType": "DDI",
        "phoneNumber": "",
        "phoneAreaCode": "",
        "phoneCountryCode": ""
      },
      {
        "phoneType": "DEFAULT",
        "phoneNumber": "",
        "phoneAreaCode": "",
        "phoneCountryCode": ""
      },
      {
        "phoneType": "FAX",
        "phoneNumber": "",
        "phoneAreaCode": "",
        "phoneCountryCode": ""
      },
      {
        "phoneType": "MOBILE",
        "phoneNumber": "",
        "phoneAreaCode": "",
        "phoneCountryCode": ""
      }
    ],
    "isSupplier": true,
    "isCustomer": true,
    "updatedDateUTC": "2022-02-02T10:29:49.417Z",
    "contactGroups": [],
    "balances": {
      "accountsReceivable": {
        "outstanding": 36.3,
        "overdue": 0
      },
      "accountsPayable": {
        "outstanding": 24.2,
        "overdue": 0
      }
    },
    "hasAttachments": false,
    "hasValidationErrors": false
  },
  "billings": {
    "due_date": "WEEK",
    "frequency": "ANNUALLY",
    "has_brand_segmentation": false,
    "exclude_items_with_missing_brand": false,
    "has_budget_adjustment": true,
    "invoice_time": "14:00",
    "ref_prefix": "test",
    "xero_contact_id": "09cac7e4-da18-419e-9f78-01eb154c0caa"
  },
  "budget": 11,
  "type": "participant"
}

Delete company account

Disconnect participant from billing

DELETE /billing-service/billing/company/:company_id
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
company_id params Required: Company_id (participant id)
Example req
DELETE 'https://dev-api.shping.com/billing-service/billing/company/urn:authenticateit:participant:1'
Example Response
{
  "result": "Participant successfully disconnected from billing",
  "participant_id": "urn:authenticateit:participant:1",
  "xero_contact_id": "09cac7e4-da18-419e-9f78-01eb154c0caa"
}

Create or update company

POST /billing-service/billing/company
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
attention_name string Required: Company name (invoice to name)
participant_id string Required: urn format
email string Optional:
address_1 string Optional:
address_2 string Optional:
attention_to string Optional: Contact's name
state string Optional:
postcode string Optional:
country_code string Optional: e.g. "036" for Australia
frequency string Optional: 'WEEKLY', 'MONTHLY', 'ANNUALLY'
due_date number Optional: number of days from invoice creation
invoice_time string Optional: 'HH:MM'
has_budget_adjustment boolean Optional: default false
has_brand_segmentation boolean Optional: default false
exclude_items_with_missing_brand boolean Optional: default false
Example body
{
    "attention_name": "Bondi Sands Australia PL",
    "participant_id": "urn:authenticateit:participant:1",
    "email": "mail@mail.com",
    "address_1": "Plummer St",
    "address_2": "test2",
    "state": "VIC",
    "postcode": "574",
    "country_code": "036",
    "ref_prefix": "Bondi Sands",
    "frequency": "ANNUALLY",
    "invoice_time": "14:00",
    "due_date": "MONTH",
    "has_budget_adjustment": true,
    "has_brand_segmentation": false,
    "exclude_items_with_missing_brand": false
}
Example Response
{
  "id": "urn:authenticateit:participant:708023102856412",
  "contact": {
    "contactID": "8f6eb941-476d-4da8-b498-8d864347b2d6",
    "accountNumber": "708023102856412",
    "contactStatus": "ACTIVE",
    "name": "Wild Co",
    "emailAddress": "mail@mail.com",
    "contactPersons": [],
    "bankAccountDetails": "",
    "addresses": [
      {
        "addressType": "STREET",
        "addressLine1": "Plummer St",
        "addressLine2": "test2",
        "city": "",
        "region": "VIC",
        "postalCode": "574",
        "country": "au",
        "attentionTo": "name"
      },
      {
        "addressType": "POBOX",
        "addressLine1": "Plummer St",
        "addressLine2": "test2",
        "city": "",
        "region": "VIC",
        "postalCode": "574",
        "country": "au",
        "attentionTo": "name"
      }
    ],
    "phones": [
      {
        "phoneType": "DEFAULT",
        "phoneNumber": "",
        "phoneAreaCode": "",
        "phoneCountryCode": ""
      },
      {
        "phoneType": "DDI",
        "phoneNumber": "",
        "phoneAreaCode": "",
        "phoneCountryCode": ""
      },
      {
        "phoneType": "FAX",
        "phoneNumber": "",
        "phoneAreaCode": "",
        "phoneCountryCode": ""
      },
      {
        "phoneType": "MOBILE",
        "phoneNumber": "",
        "phoneAreaCode": "",
        "phoneCountryCode": ""
      }
    ],
    "isSupplier": false,
    "isCustomer": true,
    "salesTrackingCategories": [],
    "purchasesTrackingCategories": [],
    "updatedDateUTC": "2022-02-03T08:56:33.790Z",
    "contactGroups": [],
    "hasValidationErrors": false
  },
  "billings": {
    "frequency": "ANNUALLY",
    "due_date": "WEEK",
    "invoice_time": "14:00",
    "has_budget_adjustment": true,
    "has_brand_segmentation": false,
    "exclude_items_with_missing_brand": false,
    "xero_contact_id": "8f6eb941-476d-4da8-b498-8d864347b2d6",
    "ref_prefix": "Wild Co"
  },
  "budget": 10500,
  "type": "participant"
}

List invoices

GET /billing-service/billing/invoice
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
company_id query Required: participant_id
page query Optional: pagination, maximum 100 invoices at 1 page
include_archived query Optional:
unitdp query Optional: Decimal places (default 2)
Example req
GET https://dev-api.shping.com/billing-service/billing/invoice?company_id=urn:authenticateit:participant:1
Example Response
{
  "invoices": [
    {
      "type": "ACCPAY",
      "contact": {
        "contactID": "09cac7e4-da18-419e-9f78-01eb154c0caa",
        "name": "test name",
        "contactPersons": [],
        "addresses": [],
        "phones": [],
        "contactGroups": [],
        "hasValidationErrors": false
      },
      "lineItems": [
        {
          "lineItemID": "8e4eeb5e-a6fd-41f7-bc13-e056ea02cd7a",
          "description": "Clicks",
          "quantity": 1,
          "unitAmount": 0,
          "taxAmount": 0,
          "lineAmount": 0,
          "tracking": []
        },
        {
          "lineItemID": "ec448945-6af7-4e23-9666-0891bdcac0e5",
          "description": "Video views",
          "quantity": 1,
          "unitAmount": 0,
          "taxAmount": 0,
          "lineAmount": 0,
          "tracking": []
        },
        {
          "lineItemID": "d8484455-1734-4cb8-8369-138fb991b873",
          "description": "Reviews",
          "quantity": 1,
          "unitAmount": 2.4,
          "accountCode": "200",
          "taxType": "OUTPUT",
          "taxAmount": 0.24,
          "lineAmount": 2.4,
          "tracking": []
        },
        {
          "lineItemID": "b4031795-abbc-4c2c-b119-c0be61d6840e",
          "description": "Activations",
          "quantity": 1,
          "unitAmount": 0.9,
          "accountCode": "200",
          "taxType": "OUTPUT",
          "taxAmount": 0.09,
          "lineAmount": 0.9,
          "tracking": []
        },
        {
          "lineItemID": "ad1118ca-7fcd-4169-90d8-e308a182de59",
          "description": "Impressions",
          "quantity": 1,
          "unitAmount": 7.28,
          "accountCode": "200",
          "taxType": "OUTPUT",
          "taxAmount": 0.73,
          "lineAmount": 7.28,
          "tracking": []
        },
        {
          "lineItemID": "f0a26f42-a68a-455c-a267-7f40a1b65f09",
          "description": "Cashback handle fee",
          "quantity": 1,
          "unitAmount": 26.31,
          "accountCode": "200",
          "taxType": "OUTPUT",
          "taxAmount": 2.63,
          "lineAmount": 26.31,
          "tracking": []
        },
        {
          "lineItemID": "74647557-c5ae-4ccc-8301-8c0e50d160d7",
          "description": "Cashback trasnaction fee",
          "quantity": 1,
          "unitAmount": 4.9,
          "accountCode": "200",
          "taxType": "OUTPUT",
          "taxAmount": 0.49,
          "lineAmount": 4.9,
          "tracking": []
        },
        {
          "lineItemID": "83e9fc19-1a7a-43fb-9ee9-98152749d724",
          "description": "Cashback passthrough",
          "quantity": 1,
          "unitAmount": 1263.08,
          "accountCode": "200",
          "taxType": "OUTPUT",
          "taxAmount": 126.31,
          "lineAmount": 1263.08,
          "tracking": []
        },
        {
          "lineItemID": "10ea6e2a-9e45-4ccb-9c18-e19489012db0",
          "description": "Discount",
          "quantity": 1,
          "unitAmount": -1293.87,
          "accountCode": "200",
          "taxType": "OUTPUT",
          "taxAmount": -129.39,
          "lineAmount": -1293.87,
          "tracking": []
        }
      ],
      "date": "2022-01-31T00:00:00.000Z",
      "dueDate": "2022-03-03T00:00:00.000Z",
      "lineAmountTypes": "Exclusive",
      "invoiceNumber": "",
      "reference": "Jan 2022",
      "currencyCode": "AUD",
      "currencyRate": 1,
      "status": "DRAFT",
      "subTotal": 11,
      "totalTax": 1.1,
      "total": 12.1,
      "invoiceID": "505c8117-6bb7-4259-ae1e-0d76d36579fb",
      "hasAttachments": false,
      "isDiscounted": false,
      "payments": [],
      "prepayments": [],
      "overpayments": [],
      "amountDue": 12.1,
      "amountPaid": 0,
      "amountCredited": 0,
      "updatedDateUTC": "2022-01-31T07:40:14.657Z",
      "creditNotes": [],
      "hasErrors": false
    },
    {
      "type": "ACCPAY",
      "contact": {
        "contactID": "09cac7e4-da18-419e-9f78-01eb154c0caa",
        "name": "test name",
        "contactPersons": [],
        "addresses": [],
        "phones": [],
        "contactGroups": [],
        "hasValidationErrors": false
      },
      "lineItems": [
        {
          "lineItemID": "1c1d7913-4a4c-4acb-9078-e30765359378",
          "description": "Clicks",
          "quantity": 1,
          "unitAmount": 0,
          "taxAmount": 0,
          "lineAmount": 0,
          "tracking": []
        },
        {
          "lineItemID": "4d6152fb-62f0-4fe2-8d0a-d79132734654",
          "description": "Video views",
          "quantity": 1,
          "unitAmount": 0,
          "taxAmount": 0,
          "lineAmount": 0,
          "tracking": []
        },
        {
          "lineItemID": "22c850c1-ebdd-472a-a6fb-db0bde43607b",
          "description": "Reviews",
          "quantity": 1,
          "unitAmount": 2.4,
          "accountCode": "200",
          "taxType": "OUTPUT",
          "taxAmount": 0.24,
          "lineAmount": 2.4,
          "tracking": []
        },
        {
          "lineItemID": "d8813440-3540-4093-9197-95aa383779df",
          "description": "Activations",
          "quantity": 1,
          "unitAmount": 0.9,
          "accountCode": "200",
          "taxType": "OUTPUT",
          "taxAmount": 0.09,
          "lineAmount": 0.9,
          "tracking": []
        },
        {
          "lineItemID": "306ee0bb-36a7-453a-99f1-376e31a7c75c",
          "description": "Impressions",
          "quantity": 1,
          "unitAmount": 7.28,
          "accountCode": "200",
          "taxType": "OUTPUT",
          "taxAmount": 0.73,
          "lineAmount": 7.28,
          "tracking": []
        },
        {
          "lineItemID": "503b84eb-18c1-42e9-b35c-d38eb305b034",
          "description": "Cashback handle fee",
          "quantity": 1,
          "unitAmount": 26.31,
          "accountCode": "200",
          "taxType": "OUTPUT",
          "taxAmount": 2.63,
          "lineAmount": 26.31,
          "tracking": []
        },
        {
          "lineItemID": "82471833-d6c6-4e91-8a5f-9728c9debf81",
          "description": "Cashback trasnaction fee",
          "quantity": 1,
          "unitAmount": 4.9,
          "accountCode": "200",
          "taxType": "OUTPUT",
          "taxAmount": 0.49,
          "lineAmount": 4.9,
          "tracking": []
        },
        {
          "lineItemID": "e7af3c75-364d-4f6a-b602-0439d6b538bc",
          "description": "Cashback passthrough",
          "quantity": 1,
          "unitAmount": 1263.08,
          "accountCode": "200",
          "taxType": "OUTPUT",
          "taxAmount": 126.31,
          "lineAmount": 1263.08,
          "tracking": []
        },
        {
          "lineItemID": "8d2deeb5-1140-4d60-b18d-830bb489438a",
          "description": "Discount",
          "quantity": 1,
          "unitAmount": -1293.87,
          "accountCode": "200",
          "taxType": "OUTPUT",
          "taxAmount": -129.39,
          "lineAmount": -1293.87,
          "tracking": []
        }
      ],
      "date": "2022-01-31T00:00:00.000Z",
      "dueDate": "2022-03-03T00:00:00.000Z",
      "lineAmountTypes": "Exclusive",
      "invoiceNumber": "",
      "reference": "Jan 2022",
      "currencyCode": "AUD",
      "currencyRate": 1,
      "status": "DRAFT",
      "subTotal": 11,
      "totalTax": 1.1,
      "total": 12.1,
      "invoiceID": "07356d00-7ff8-4b2a-be19-0e721ec3ddd5",
      "hasAttachments": false,
      "isDiscounted": false,
      "payments": [],
      "prepayments": [],
      "overpayments": [],
      "amountDue": 12.1,
      "amountPaid": 0,
      "amountCredited": 0,
      "updatedDateUTC": "2022-01-31T07:54:11.110Z",
      "creditNotes": [],
      "hasErrors": false
    }
  ]
}

Get invoice

GET /billing-service/billing/invoice/:invoice_id
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
invoice_id params Required: uuid of the invoice
Example req
GET https://dev-api.shping.com/billing-service/billing/invoice/505c8117-6bb7-4259-ae1e-0d76d36579fb
Example Response
{
  "result": {
    "type": "ACCPAY",
    "contact": {
      "contactID": "09cac7e4-da18-419e-9f78-01eb154c0caa",
      "name": "test name",
      "contactPersons": [],
      "addresses": [
        {
          "addressType": "STREET",
          "addressLine1": "Plummer St",
          "addressLine2": "test2",
          "city": "",
          "region": "VIC",
          "postalCode": "574",
          "country": "au",
          "attentionTo": "Emma Quirk"
        },
        {
          "addressType": "POBOX",
          "addressLine1": "Plummer St",
          "addressLine2": "test2",
          "city": "",
          "region": "VIC",
          "postalCode": "574",
          "country": "au",
          "attentionTo": "Emma Quirk"
        }
      ],
      "phones": [
        {
          "phoneType": "DEFAULT",
          "phoneNumber": "",
          "phoneAreaCode": "",
          "phoneCountryCode": ""
        },
        {
          "phoneType": "DDI",
          "phoneNumber": "",
          "phoneAreaCode": "",
          "phoneCountryCode": ""
        },
        {
          "phoneType": "FAX",
          "phoneNumber": "",
          "phoneAreaCode": "",
          "phoneCountryCode": ""
        },
        {
          "phoneType": "MOBILE",
          "phoneNumber": "",
          "phoneAreaCode": "",
          "phoneCountryCode": ""
        }
      ],
      "contactGroups": [],
      "hasValidationErrors": false
    },
    "lineItems": [
      {
        "lineItemID": "8e4eeb5e-a6fd-41f7-bc13-e056ea02cd7a",
        "description": "Clicks",
        "quantity": 1,
        "unitAmount": 0,
        "taxAmount": 0,
        "lineAmount": 0,
        "tracking": []
      },
      {
        "lineItemID": "ec448945-6af7-4e23-9666-0891bdcac0e5",
        "description": "Video views",
        "quantity": 1,
        "unitAmount": 0,
        "taxAmount": 0,
        "lineAmount": 0,
        "tracking": []
      },
      {
        "lineItemID": "d8484455-1734-4cb8-8369-138fb991b873",
        "description": "Reviews",
        "quantity": 1,
        "unitAmount": 2.4,
        "accountCode": "200",
        "taxType": "OUTPUT",
        "taxAmount": 0.24,
        "lineAmount": 2.4,
        "tracking": []
      },
      {
        "lineItemID": "b4031795-abbc-4c2c-b119-c0be61d6840e",
        "description": "Activations",
        "quantity": 1,
        "unitAmount": 0.9,
        "accountCode": "200",
        "taxType": "OUTPUT",
        "taxAmount": 0.09,
        "lineAmount": 0.9,
        "tracking": []
      },
      {
        "lineItemID": "ad1118ca-7fcd-4169-90d8-e308a182de59",
        "description": "Impressions",
        "quantity": 1,
        "unitAmount": 7.28,
        "accountCode": "200",
        "taxType": "OUTPUT",
        "taxAmount": 0.73,
        "lineAmount": 7.28,
        "tracking": []
      },
      {
        "lineItemID": "f0a26f42-a68a-455c-a267-7f40a1b65f09",
        "description": "Cashback handle fee",
        "quantity": 1,
        "unitAmount": 26.31,
        "accountCode": "200",
        "taxType": "OUTPUT",
        "taxAmount": 2.63,
        "lineAmount": 26.31,
        "tracking": []
      },
      {
        "lineItemID": "74647557-c5ae-4ccc-8301-8c0e50d160d7",
        "description": "Cashback trasnaction fee",
        "quantity": 1,
        "unitAmount": 4.9,
        "accountCode": "200",
        "taxType": "OUTPUT",
        "taxAmount": 0.49,
        "lineAmount": 4.9,
        "tracking": []
      },
      {
        "lineItemID": "83e9fc19-1a7a-43fb-9ee9-98152749d724",
        "description": "Cashback passthrough",
        "quantity": 1,
        "unitAmount": 1263.08,
        "accountCode": "200",
        "taxType": "OUTPUT",
        "taxAmount": 126.31,
        "lineAmount": 1263.08,
        "tracking": []
      },
      {
        "lineItemID": "10ea6e2a-9e45-4ccb-9c18-e19489012db0",
        "description": "Discount",
        "quantity": 1,
        "unitAmount": -1293.87,
        "accountCode": "200",
        "taxType": "OUTPUT",
        "taxAmount": -129.39,
        "lineAmount": -1293.87,
        "tracking": []
      }
    ],
    "date": "2022-01-31T00:00:00.000Z",
    "dueDate": "2022-03-03T00:00:00.000Z",
    "lineAmountTypes": "Exclusive",
    "invoiceNumber": "",
    "reference": "Jan 2022",
    "url": "https://go.xero.com/AccountsReceivable/View.aspx?InvoiceID=505c8117-6bb7-4259-ae1e-0d76d36579fb",
    "currencyCode": "AUD",
    "currencyRate": 1,
    "status": "DRAFT",
    "sentToContact": false,
    "subTotal": 11,
    "totalTax": 1.1,
    "total": 12.1,
    "invoiceID": "505c8117-6bb7-4259-ae1e-0d76d36579fb",
    "hasAttachments": false,
    "isDiscounted": false,
    "prepayments": [],
    "overpayments": [],
    "amountDue": 12.1,
    "amountPaid": 0,
    "updatedDateUTC": "2022-01-31T07:40:14.657Z",
    "hasErrors": false
  }
}

Create invoice

POST /billing-service/billing/invoice/
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
company_id string Required: Participant id
invoice_date date Required:
due_date date Required:
currency_code string Optional: default 'AUD'
invoice_number string Optional:
items array Required:
unitdp number Required: Decimal places (default 2)

items structure : -- description: String, required -- quantity: Number, required -- unit_amount: Number, required -- tax_type: String, default 'OUTPUT' -- discount_amount: Number

Example req
{
    "invoice_date": "2021-01-01",
    "company_id": "urn:authenticateit:participant:1",
    "due_date": "2021-01-01",
    "items": [{
        "description": "test",
        "quantity": 1,
        "unit_amount": 10
    }]
}
Example Response
{
  "result": {
    "type": "ACCREC",
    "contact": {
      "contactID": "09cac7e4-da18-419e-9f78-01eb154c0caa",
      "name": "test name",
      "contactPersons": [],
      "addresses": [
        {
          "addressType": "STREET",
          "addressLine1": "Plummer St",
          "addressLine2": "test2",
          "city": "",
          "region": "VIC",
          "postalCode": "574",
          "country": "au",
          "attentionTo": "Emma Quirk"
        },
        {
          "addressType": "POBOX",
          "addressLine1": "Plummer St",
          "addressLine2": "test2",
          "city": "",
          "region": "VIC",
          "postalCode": "574",
          "country": "au",
          "attentionTo": "Emma Quirk"
        }
      ],
      "phones": [
        {
          "phoneType": "DEFAULT",
          "phoneNumber": "",
          "phoneAreaCode": "",
          "phoneCountryCode": ""
        },
        {
          "phoneType": "DDI",
          "phoneNumber": "",
          "phoneAreaCode": "",
          "phoneCountryCode": ""
        },
        {
          "phoneType": "FAX",
          "phoneNumber": "",
          "phoneAreaCode": "",
          "phoneCountryCode": ""
        },
        {
          "phoneType": "MOBILE",
          "phoneNumber": "",
          "phoneAreaCode": "",
          "phoneCountryCode": ""
        }
      ],
      "contactGroups": [],
      "hasValidationErrors": false
    },
    "lineItems": [
      {
        "lineItemID": "b01d79e4-0443-4a0e-abe2-aef38f77e3cb",
        "description": "test",
        "quantity": 1,
        "unitAmount": 10,
        "accountCode": "200",
        "taxType": "OUTPUT",
        "taxAmount": 1,
        "lineAmount": 10,
        "tracking": []
      }
    ],
    "date": "2021-01-01T00:00:00.000Z",
    "dueDate": "2021-01-01T00:00:00.000Z",
    "lineAmountTypes": "Exclusive",
    "invoiceNumber": "ORC1078",
    "reference": "",
    "brandingThemeID": "aefae6d5-7bbe-4e2e-aadc-302cd07a0fc1",
    "url": "https://go.xero.com/AccountsReceivable/View.aspx?InvoiceID=26e8c54b-c461-43fa-9748-b69e6ab30fdd",
    "currencyCode": "AUD",
    "currencyRate": 1,
    "status": "DRAFT",
    "sentToContact": false,
    "subTotal": 10,
    "totalTax": 1,
    "total": 11,
    "invoiceID": "26e8c54b-c461-43fa-9748-b69e6ab30fdd",
    "isDiscounted": false,
    "prepayments": [],
    "overpayments": [],
    "amountDue": 11,
    "amountPaid": 0,
    "updatedDateUTC": "2022-02-03T08:57:52.830Z",
    "hasErrors": false
  }
}

results matching ""

    No results matching ""