Skip to main content
POST
/
v3
/
payin
Create a payin
curl --request POST \
  --url https://service-sandbox.tazapay.com/v3/payin \
  --header 'Authorization: Basic <encoded-value>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "invoice_currency": "INR",
  "amount": 100,
  "customer_details": {
    "name": "Andrea Lark",
    "country": "SG",
    "email": "andrea@example.com",
    "phone": {
      "calling_code": "65",
      "number": "87654321"
    }
  },
  "billing_details": {
    "address": {
      "city": "Singapore",
      "country": "SG",
      "line1": "1st Street",
      "line2": "2nd Avenue",
      "postal_code": "43004",
      "state": "Singapore"
    },
    "label": "Home",
    "name": "Andrea Lark",
    "phone": {
      "calling_code": "65",
      "number": "87654321"
    }
  },
  "shipping_details": {
    "address": {
      "city": "Singapore",
      "country": "SG",
      "line1": "1st Street",
      "line2": "2nd Avenue",
      "postal_code": "43004",
      "state": "Singapore"
    },
    "label": "Home",
    "name": "Andrea Lark",
    "phone": {
      "calling_code": "65",
      "number": "87654321"
    }
  },
  "success_url": "https://mystore.com/success_page",
  "cancel_url": "https://mystore.com/try_again",
  "webhook_url": "https://mystore.com/internal/webhook",
  "payment_methods": [
    "paynow_sgd",
    "card"
  ],
  "transaction_description": "test",
  "metadata": {
    "key1": "value1",
    "key2": "value2",
    "key3": "value3"
  },
  "reference_id": "string",
  "confirm": false,
  "statement_descriptor": "string",
  "payment_method_details": {
    "key": "value"
  },
  "session_id": "test_session_id"
}
'
{
  "status": "success",
  "message": "",
  "data": {
    "amount": 100,
    "amount_paid": 0,
    "billing_details": {
      "address": {
        "city": "Singapore",
        "country": "SG",
        "line1": "1st Street",
        "line2": "2nd Avenue",
        "postal_code": "43004",
        "state": "Singapore"
      },
      "label": "Home",
      "name": "Andrea Lark",
      "phone": {
        "calling_code": "65",
        "number": "87654321"
      }
    },
    "cancel_url": "https://mystore.com/try_again",
    "cancelled_at": null,
    "client_token": "ZRjM4ROfY6SPjTaQkz00OszWUcVvMA8KhStkPAoamPQ=",
    "confirm": false,
    "created_at": "2024-10-01T10:08:30.666381739Z",
    "customer": "cus_crtqrhth90j0121gpt50",
    "customer_details": {
      "country": "SG",
      "email": "andrea@example.com",
      "name": "Andrea Lark",
      "phone": {
        "calling_code": "65",
        "number": "87654321"
      }
    },
    "form": "",
    "holding_currency": "INR",
    "id": "pay_crtsk7i6avg0t9ndc7l0",
    "invoice_currency": "INR",
    "items": [],
    "latest_payment_attempt": "",
    "latest_payment_attempt_data": null,
    "metadata": {
      "key1": "value1",
      "key2": "value2",
      "key3": "value3"
    },
    "object": "payin",
    "paid_in_excess": false,
    "partially_paid": false,
    "payment_attempts": [],
    "payment_method_details": {
      "key": "value"
    },
    "reference_id": "string",
    "shipping_details": {
      "address": {
        "city": "Singapore",
        "country": "SG",
        "line1": "1st Street",
        "line2": "2nd Avenue",
        "postal_code": "43004",
        "state": "Singapore"
      },
      "label": "Home",
      "name": "Andrea Lark",
      "phone": {
        "calling_code": "65",
        "number": "87654321"
      }
    },
    "statement_descriptor": "tzp*string",
    "status": "requires_payment_method",
    "status_description": "",
    "success_url": "https://mystore.com/success_page",
    "transaction_data": [],
    "transaction_description": "test",
    "transaction_documents": [],
    "webhook_url": "https://mystore.com/internal/webhook"
  }
}
After the payin is created, provide payment method details and confirm the payin. When you use confirm = true during creation, you create and confirm the payin in the same API call. You MUST use the parameters in confirm API when you supply confirm = true

Authorizations

Authorization
string
header
required

Basic authentication header of the form Basic <encoded-value>, where <encoded-value> is the base64-encoded string username:password.

Body

application/json
invoice_currency
string
default:""
required

Invoice currency for the checkout session (in uppercase, iso-4217 standard). By default, the invoice currency is the holding currency for the transaction.

amount
integer<int32>
default:""
required

Amount in cents. For example if you want to charge $10.12 pass 1012 as the value. For decimal handling for various currencies, refer to the guide here

transaction_description
string
default:""
required

A short description to be displayed on the Tazapay hosted checkout screen

customer_details
object

Details about the customer

customer
string

ID of the customer for the checkout session

success_url
string

URL where the customer is directed to after a successful payment

cancel_url
string

The URL the customer will be directed to if they decide to cancel payment and return to your website.

shipping_details
object

Shipping Details - Address, Recipient Name

billing_details
object

Billing Details - Address, Recipient Name

transaction_documents
string<json>

Supporting documents for the transaction

metadata
string<json>

Set of key-value pairs that can be attached to the checkout session

reference_id
string

Your unique identifier for the session

confirm
boolean
default:false

Set to true to confirm this payin immediately. The parameter defaults to false. When creating and confirming a payin at the same time, you can also provide the parameters in the confirm API

statement_descriptor
string

Configure the description of the payment on your customer's statements. It must contain at least one letter and be 1-22 characters long

payment_method_details
string<json>

Pass the data specific to a payment method to confirm a payin and create a payment attempt

session_id
string

Session ID retrieved from the risk SDK

Response

200 - application/json

200

status
string

Indicates whether the payin creation request succeeded.

message
string

Response message or additional context regarding the payin request.

data
object

Contains detailed information about the created payin.

form
string