Create a payment

Creates a payment object.

After the payment is created, the payer will have to click on 'Proceed' to select the payment method, fill in their payment details and confirm to complete the payment transaction.

Parameters


reference_id required

The agency’s reference id in their preferred format. Invoice number is commonly used. It should not exceed a maximum of 255 characters.


payer_name required

Name of citizen or company making the payment. It should not exceed a maximum of 255 characters.


payer_address optional

Address of citizen on company making the payment. It should not exceed a maximum of 255 characters.


payer_identifier optional

Tax identifier of payer. e.g. NRIC, UEN. It should not exceed a maximum of 10 characters.


payer_email optional

Email address that should receive the payment link and invoice. It should not exceed a maximum of 255 characters.


description required

Description of what the payment is for. This will be shown to the payer in the payment link. It should not exceed a maximum of 500 characters.


amount_in_cents required

The total amount that the citizen or company should pay. It should not exceed a maximum of 99999999, which is equivalent to $999999.99.


due_date optional

Expected due date for the payment. This will be displayed in emails and reminders sent to the payer. It should be in the format dd-MMM-yyyy. e.g. 31-DEC-2023.


metadata optional

Additional metadata related to this payment. Metadata only supports up to 10 entries. Keys must be at most 40 characters long. Values must be at most 255 characters long.

Example:

"metadata": {
		"branch_code": "123",
		"pos_ID": "456",
		"cashier_ID": "001",
		"receipt_number": "789"
	}

line_items optional


Line item breakdown of the payment. Unlimited entries are supported. The description key must not exceed 255 characters. The total amount for all line items should not exceed 20000000 cents.

Example:

"line_items": [
    {
      "description": "Payment for season ticket",
      "quantity": 10,
      "unit_amount_in_cents": 100
    }
  ]

Returns


Returns a payment object.

The payment object will be the payment to be created.

POST /v1/payment-services/:payment_service_id/payments


{
    "reference_id": "PAYMENT_001",
    "payer_name": "Andy Lau",
    "payer_address": "Blk 123, Yishun Avenue 2, #08-88, Singapore 123456",
    "payer_identifier": "S1234567A",
    "payer_email": "abc@gmail.com",
    "description": "Payment for XXX",
    "amount_in_cents": 1100,
		"due_date": "31-DEC-2023", // optional
		"return_url": "https://open.gov.sg" //optional
    "metadata": {
			"product code": "123" // can add other key-value pairs here
		}
}

RESPONSE

{
    "id": "ZbzTvadjmP0wd7RRxhWtj",
    "due_date": null,
    "metadata": {
			"product code": "123",
		},
    "payout_id": null,
    "created_at": "2023-08-03T17:36:52.634+08:00",
    "creator_id": "user_xxx",
    "payer_name": "Andy Lau",
    "updated_at": "2023-08-03T17:36:52.634+08:00",
    "description": "Payment for XXX",
    "payer_email": "abc@gmail.com",
    "payment_url": "http://pay.gov.sg/payments/ZbzTvadjmP0wd7RRxhWtj",
		"return_url": "https://open.gov.sg"
    "reference_id": "PAYMENT_001",
    "latest_status": "unpaid",
    "payer_address": "Blk 123, Yishun Avenue 2, #08-88, Singapore 123456",
    "refund_status": "not_refunded",
    "payment_status": "unpaid",
    "amount_in_cents": 1100,
    "payer_identifier": "S1234567A",
    "paid_out_timestamp": null,
    "payment_service_id": "payment_service_xxx",
    "email_delivery_status": "unsent",
    "payment_sent_timestamp": null,
    "stripe_payment_intent_id": "pi_xxx",
    "payment_cancelled_timestamp": null,
    "payment_succeeded_timestamp": null,
    "payment_fully_refunded_timestamp": null
}

Last updated