Synswi
  1. Invoice
Synswi
  • Guides
    • Getting Started With the API
  • API Reference
    • Accounts
      • Onboarding forms
        • Create a Onboarding Form
      • Get account setting
      • Update account setting
      • Get profile
      • Create new profile
      • Register webhook
    • Devices
      • Get Devices
    • Dispute
      • Get disputes
    • 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 a payment instrument by id
      • Create a Payment Instrument
    • Transactions
      • Get a transaction by id
      • Get transactions
      • Create a transaction
    • Settlements
      • get settlements
      • get settlement entries
    • Identity
      • Register an user
      • Validate Token
      • Create an api key
      • List api keys
      • Get Users
    • Programs
      • Accounts
    • Permission
      • Verify user permissions
      • Get Account Users
  1. Invoice

Create an invoice

POST
https://api-dev.synswi.com/invoices

Request

Authorization
Provide your bearer token in the
Authorization
header when making requests to protected resources.
Example:
Authorization: Bearer ********************
Body Params application/json

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 Code 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-dev.synswi.com/invoices' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data-raw '{   
    "accountId": "acc-c068c34e-b12d-48b1-bc5f-c85edae9fc9b",
    "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

Example
{
    "id": "string",
    "status": "created"
}
Previous
Get invoices
Next
Pay an invoice
Built with