Create Bill
POST/v2/pwf/bill
An endpoint to create a payment/bill link
Request
- application/x-www-form-urlencoded
Body
required
- 1: input-data
- 2: payment-method
- 3: payment-confirmation
- bank_account: for payment method using bank transfer
- virtual_account: payment method using virtual account
- wallet_account: payment method using E-Wallets
- online_to_offline_account: payment method using retail store (Alfamart)
- credit_card_account: payment method using credit card
The title of the bill.
Possible values: [SINGLE, MULTIPLE]
Bill type. For bill created with step 3 only SINGLE is permissible.
Payment amount, minimum Rp10.000. Leave blank if want to set a flexible amount. Optional for bill created with Step 1 and mandatory for bill created with Step 2/ Step 3.
Bill expiry date. The bill can’t be used any more beyond the expiry date. Format YYYY-MM-DD HH:mm
Redirect URL after payment is success.
A flag if user needs to input their address when creating payment. 0 is false (default)
A flag if user needs to input their address when creating payment. 0 is false (default)
Which step the customers will be redirected to when opening the payment link.
Name of the Customer.
Email of the Customer.
Phone number of the Customer.
Address of the Customer.
Bank that is used for the payment. Value will be bank_code of Flip.
Possible values: [bank_account, virtual_account, wallet_account, online_to_offline_account, credit_card_account]
Responses
- 200
- 401
- 422
Expected Create bill Response
- application/json
- Schema
- Example (from schema)
- step1Example
- step2Example
- step3Example
Schema
- CreateBillStep1
- CreateBillStep2
- CreateBillStep3
oneOf
customer
object
customer
object
bill_payment
object
receiver_bank_account
object
{}
{
"link_id": 1,
"link_url": "flip.id/$companyname/#coffeetable",
"title": "Coffee Table",
"type": "SINGLE",
"amount": 900000,
"redirect_url": "https://someurl.com",
"expired_date": "2022-12-30 15:50:00",
"created_from": "API",
"status": "ACTIVE",
"is_address_required": 0,
"is_phone_number_required": 0,
"step": 1
}
{
"link_id": 1,
"link_url": "flip.id/$companyname/#coffeetable",
"title": "Coffee Table",
"type": "SINGLE",
"amount": 900000,
"redirect_url": "https://someurl.com",
"expired_date": "2022-12-30 15:50:00",
"created_from": "API",
"status": "ACTIVE",
"is_address_required": 0,
"is_phone_number_required": 0,
"step": 2,
"customer": {
"name": "Customer a",
"email": "customer@gmail.com",
"address": "Jl. Imam Bonjol No.39, Jakarta.",
"phone": "+62888888888"
}
}
{
"link_id": 3276,
"link_url": "flip.id/$autobisonmaster/#testpgpayment303-5",
"title": "Test PG Payment 303",
"type": "SINGLE",
"amount": 50000,
"redirect_url": "",
"expired_date": null,
"created_from": "API",
"status": "ACTIVE",
"is_address_required": 0,
"is_phone_number_required": 0,
"step": 3,
"customer": {
"name": "Customer A",
"email": "customer@gmail.com",
"address": "Jl. Imam Bonjol No.39, Jakarta.",
"phone": "+62888888888"
},
"bill_payment": {
"id": "62d8ddde3e10b",
"amount": 50000,
"unique_code": 0,
"status": "PENDING",
"sender_bank": "mandiri",
"sender_bank_type": "virtual_account",
"receiver_bank_account": {
"account_number": "3453280274531212",
"account_type": "virtual_account",
"bank_code": "mandiri",
"account_holder": "Customer A"
},
"user_address": "Jl. Imam Bonjol No.39, Jakarta.",
"user_phone": "+62888888888",
"created_at": 1658379743
},
"payment_url": "https://flip.id/pwf/transaction/consolidated?redirected_from=internal&id=62d8ddde3e10b"
}
Sample response when Your Flip api secret key value for Authorization is missing or invalid
- application/json; charset=UTF-8
- Schema
- Example (from schema)
Schema
{
"name": "Unauthorized",
"message": "Your request was made with invalid credentials.",
"status": 401
}
Expected Error Response
- application/json; charset=UTF-8
- Schema
- Example (from schema)
- Mising Required Fields
- Mising title Field
- Mising type Field
- Mising expired_date Field
- Missing sender_name field
- Missing sender_email field
- Missing sender_phone_number field
- Missing sender_address field
- Missing sender_bank field
Schema
Array [
]
errors
object[]
{
"code": "VALIDATION_ERROR",
"errors": [
{
"attribute": "title",
"code": 1043,
"message": "Param title is required"
}
]
}
{
"code": "VALIDATION_ERROR",
"errors": [
{
"attribute": "title",
"code": 1043,
"message": "Param title is required"
},
{
"attribute": "type",
"code": 1044,
"message": "Param type is required"
},
{
"attribute": "expired_date",
"code": 1047,
"message": "Param expired_date is invalid"
},
{
"attribute": "sender_name",
"code": 1070,
"message": "Param sender_name is required"
},
{
"attribute": "sender_email",
"code": 1072,
"message": "Param sender_email is required"
},
{
"attribute": "sender_phone_number",
"code": 1073,
"message": "Param sender_phone_number is required"
},
{
"attribute": "sender_address",
"code": 1075,
"message": "Param sender_address is required"
},
{
"attribute": "sender_bank",
"code": 1077,
"message": "Param sender_bank is required"
}
]
}
{
"code": "VALIDATION_ERROR",
"errors": [
{
"attribute": "title",
"code": 1043,
"message": "Param title is required"
}
]
}
{
"code": "VALIDATION_ERROR",
"errors": [
{
"attribute": "type",
"code": 1044,
"message": "Param type is required"
}
]
}
{
"code": "VALIDATION_ERROR",
"errors": [
{
"attribute": "expired_at",
"code": 1047,
"message": "Param expired_date is invalid"
}
]
}
{
"code": "VALIDATION_ERROR",
"errors": [
{
"attribute": "sender_name",
"code": 1070,
"message": "Param sender_name is required"
}
]
}
{
"code": "VALIDATION_ERROR",
"errors": [
{
"attribute": "sender_email",
"code": 1072,
"message": "Param sender_email is required"
}
]
}
{
"code": "VALIDATION_ERROR",
"errors": [
{
"attribute": "sender_phone_number",
"code": 1073,
"message": "Param sender_phone_number is required"
}
]
}
{
"code": "VALIDATION_ERROR",
"errors": [
{
"attribute": "sender_address",
"code": 1075,
"message": "Param sender_address is required"
}
]
}
{
"code": "VALIDATION_ERROR",
"errors": [
{
"attribute": "sender_bank",
"code": 1077,
"message": "Param sender_bank is required"
}
]
}
Callbacks
- POST acceptPaymentCallback
POST/your-callback-url
Accept payment callback will be sent to you if there is a payment status that changed to SUCCESSFUL, CANCELLED, or FAILED. Please make sure that you have set the Accept Payment callback URL on the Flip for Business dashboard.
- application/x-www-form-urlencoded
Body
- SUCCESSFUL
- FAILED
- PENDING
data
object
JSON array string with content exactly the same as the response of disbursement or bank account inquiry.
Flip’s transaction id
Bill link URL for the user.
Bill link ID.
Title of the bill.
Name of the Customer.
Bank that is used for the payment.
Email of the Customer.
Payment amount.
Status of the transaction
Type of the sender bank that is used for the payment.
The time when the payment is created. Time will be in GMT+7 with yyyy-mm-dd hh:mm:ss format
Validation token to ensure that the callback is coming from our server. You can get your token in your Flip for Business dashboard.
Callbacks Responses
- 200
URL must return a 200 HTTP Status Code. If the URL returns another HTTP Status Code or if our system doesn’t receive any response within 30 seconds (timeout), our system will retry the request 5 times, with a 2-minute interval for the transaction callback (Money Transfer, Accept Payment, International Transfer).