Synswi
  1. Payment instruments
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. Payment instruments

Create a payment instrument

Tokenization#

Use iframe from tokenization-form-sandbox.synswi.com/card-form and tokenization-form-sandbox.synswi.com/bank-form with query parameter accountId
1.
Render the iframe
2.
Post message with a type of submit_form to iframe
3.
Listen to message event with type of tokenization_success to get the paymentInstrumentId
Below are all the messages events the iframe emits:
1.
This event tells the paymentInstrumentId that you will use to create a transaction
{ 
    paymentInstrumentId: "string", 
    type: "tokenization_success" 
}
2.
This event is emitted when the tokenization fails for some reason. Message field contains the relevant reason
{ 
    message: "string", 
    type: "tokenization_failure"
}
3.
This event is emitted every second, and the height field tells the current iframe content's height. You could listen to this event to dynamically update the iframe's container's height
{ 
    height: "number", 
    type: "set_height"
}
Below are all the messages that you will send to iframe:
1.
This event tells the iframe to create a payment instrument using the information currently in the form
2.
This event tells the iframe to clear all the contents in the form
Previous
Update an invoice
Next
Get payment instruments
Built with