Synswi
  1. Invoice
Synswi
  • Invoice
    • Get invoice by id
      GET
    • Get invoices
      GET
    • Create an invoice
      POST
    • Pay an invoice
      POST
    • Send Invoice
      POST
    • Update an invoice
      POST
  • Payment instruments
    • Create a payment instrument
    • Get payment instruments
      GET
    • Get a payment instrument by id
      GET
  • Transactions
    • Get a transaction by id
      GET
    • Get transactions
      GET
    • Create a transaction
      POST
  1. Invoice

Create an invoice

POST
https://api-sandbox.synswi.com/v1/invoices

Request

Authorization
Provide your bearer token in the
Authorization
header when making requests to protected resources.
Example:
Authorization: Bearer ********************
Body Params application/json
accountId
string 
required
sender
object 
optional
If not provided, sender.name will be the business name
name
string 
required
email
string 
required
If not provided, sender.email will be the business email
recipient
object 
required
email
string 
required
name
string 
required
items
array [object {3}] 
required
Invoice Items, displayed in the invoice body
name
string 
required
quantity
integer 
required
unitPrice
integer 
required
allowedPaymentMethods
array[string]
required
Allowed values:
cardach
cardPaymentOptions
object 
optional
Includes some advanced options, when customers pay using cards
surchargeAmount
integer 
required
Amount in cents that you want to surcharge your customer
taxRate
number 
optional
The tax rate associated with this invoice. The percentage basis points. Optional
tags
object 
required
User defined key value pairs
name
string 
required
Example

{   
    "accountId": "{{accountId}}",
    "sender": {
        "name": "Synswi"
    },
    "recipient": {
        "email": "lx864079393@gmail.com",
        "name": "Xiang Li"
    },
    "items": [
        {"name": "development", "quantity": 20, "unitPrice": 50},
        {"name": "service charge", "quantity": 2, "unitPrice": 300}

    ],
    "contactEmail": "richyyu1003@gmail.com",
    "allowedPaymentMethods": [],
    "cardPaymentOptions": {
        "surchargeAmount": 0
    },
    "tags": {
        "ok": "1"
    },
    "taxAmount": 0,
    "taxRate":300,
    "totalAmount": 700
}

Request samples

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://api-sandbox.synswi.com/v1/invoices' \
--header 'Content-Type: application/json' \
--data-raw '{   
    "accountId": "acc-c068c34e-b12d-48b1-bc5f-c85edag8tgiut",
    "sender": {
        "name": "Synswi"
    },
    "recipient": {
        "email": "lx864079393@gmail.com",
        "name": "Xiang Li"
    },
    "items": [
        {"name": "development", "quantity": 20, "unitPrice": 50},
        {"name": "service charge", "quantity": 2, "unitPrice": 300}

    ],
    "contactEmail": "richyyu1003@gmail.com",
    "allowedPaymentMethods": [],
    "cardPaymentOptions": {
        "surchargeAmount": 0
    },
    "tags": {
        "ok": "1"
    },
    "taxAmount": 0,
    "taxRate":300,
    "totalAmount": 700
}'

Responses

🟢200Success
application/json
Body
id
string 
required
ID
status
enum<string> 
required
status
Allowed values:
createdsentpaid
Example
{
    "id": "string",
    "status": "created"
}
Previous
Get invoices
Next
Pay an invoice
Built with