Synswi
  1. Payment instruments
Synswi
  • Guides
    • Getting Started With the API
  • API Reference
    • Accounts
      • Onboarding forms
        • Create a Onboarding Form
      • Get profile
      • Create new profile
      • Register webhook
      • Get Accounts
    • Account Setting
      • Get account setting
      • Update account setting
    • Devices
      • Get Devices
    • Dispute
      • Get disputes
    • Payment instruments
      • Create a payment instrument
      • Get payment instruments
        GET
      • Get a payment instrument by id
        GET
      • Create a Payment Instrument
        POST
    • Transactions
      • Get a transaction by id
      • Get transactions
      • Create a transaction
      • Update a transaction
      • Refund a transaction
    • Fees
      • Get current fee profile
    • Settlements
      • get settlements
      • get settlement entries
    • Identity
      • Register an user
      • Login
      • Validate Token
      • Create an api key
      • List api keys
      • Get Users
    • Programs
      • Accounts
    • Permission
      • Verify user permissions
      • Get Account Users
      • List Accounts
    • Events
      • Get Events
  1. Payment instruments

Create a payment instrument

Tokenization#

Use iframe from tokenization-form-environment.synswi.com/card-form and tokenization-form-environment.synswi.com/bank-form with query parameter accountId
Environment can bedev or sandbox depending on account setup
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
Get disputes
Next
Get payment instruments
Built with