> ## Documentation Index > Fetch the complete documentation index at: https://docs.xendit.co/llms.txt > Use this file to discover all available pages before exploring further. # Create Payment > This endpoint allows users to submit a payment for a specific product. It can be used for various types of payments, including utility bills, prepaid services, and other products that may or may not require a prior inquiry. ## OpenAPI ````json POST /bill-payments/v1/payment { "openapi": "3.0.0", "info": { "title": "Others", "version": "3.0.0", "description": "These APIs provide merchants with customer management, file operations, and bill payment capabilities.\n\nThey cover:\n- Customer profile management\n- File upload, retrieval, and management\n- Bill payment services for utility providers and billers in Indonesia\n", "contact": { "name": "Xendit API Support", "email": "help@xendit.co", "url": "https://www.xendit.co/support" }, "license": { "name": "Proprietary", "url": "https://www.xendit.co/terms-and-conditions/" } }, "servers": [ { "url": "https://api.xendit.co", "description": "Xendit API" } ], "tags": [ { "name": "Customers", "description": "Operations for managing customer profiles and information" }, { "name": "Files", "description": "Operations for file upload, retrieval, and management" }, { "name": "Bill Payments", "description": "Bill payment services for utility providers and billers in Indonesia" } ], "paths": { "/bill-payments/v1/payment": { "post": { "tags": [ "Bill Payments" ], "summary": "Create Payment", "description": "This endpoint allows users to submit a payment for a specific product. \nIt can be used for various types of payments, including utility bills, \nprepaid services, and other products that may or may not require a prior inquiry.\n", "operationId": "createBillPayment", "security": [ { "BasicAuth": [] } ], "parameters": [ { "name": "Idempotency-Key", "in": "header", "description": "Unique key to prevent duplicate payments. Must be unique for each payment request.", "required": true, "schema": { "type": "string" }, "example": "unique-idempotency-key-123" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BillPaymentRequest" }, "examples": { "plnPrepaid": { "summary": "PLN Prepaid Payment", "value": { "product_id": "PLN_PREPAID_50K", "customer_number": "12345678910", "inquiry_id": "inq-98765", "reference_id": "tx-pln-001", "total_amount": 53200, "additional_properties": {} } }, "plnPostpaid": { "summary": "PLN Postpaid Payment", "value": { "product_id": "PLN_POSTPAID", "customer_number": "22345678910", "inquiry_id": "inq-98766", "reference_id": "tx-pln-postpaid-001", "total_amount": 159500 } } } } } }, "responses": { "200": { "description": "Payment accepted for processing", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BillPaymentResponse" }, "examples": { "plnPrepaidPending": { "summary": "PLN Prepaid Payment - Pending", "value": { "data": { "business_id": "5f27a14a9bf05c73dd040bc8", "type": "payment", "id": "trx-98765", "properties": { "product_id": "PLN_PREPAID_50K", "customer_number": "12345678910", "reference_id": "tx-pln-001", "admin_amount": 3200, "base_amount": 50000, "total_amount": 53200, "currency": "IDR", "status": "PENDING", "fulfilled_at": null, "failure_code": null, "failure_reason": null, "customer_details": [], "product_details": [], "bill_details": [], "payment_details": [] } } } } } } } }, "400": { "$ref": "#/components/responses/ErrorStatusCode400Response" }, "402": { "$ref": "#/components/responses/ErrorStatusCode402Response" }, "404": { "$ref": "#/components/responses/ErrorStatusCode404Response" }, "409": { "$ref": "#/components/responses/ErrorStatusCode409Response" }, "502": { "$ref": "#/components/responses/ErrorStatusCode502Response" }, "503": { "$ref": "#/components/responses/ErrorStatusCode503Response" }, "504": { "$ref": "#/components/responses/ErrorStatusCode504Response" } } } } }, "components": { "schemas": { "BillPaymentRequest": { "type": "object", "required": [ "product_id", "customer_number", "reference_id", "total_amount" ], "properties": { "product_id": { "type": "string", "description": "Product identifier" }, "customer_number": { "type": "string", "description": "Customer's account/service number" }, "inquiry_id": { "type": "string", "description": "Inquiry ID from POST /inquiry (optional)" }, "reference_id": { "type": "string", "description": "Partner's unique transaction reference" }, "total_amount": { "type": "number", "description": "Total payment amount including admin fee" }, "additional_properties": { "type": "object", "description": "Additional parameters required for specific products" } } }, "BillPaymentResponse": { "type": "object", "required": [ "data" ], "properties": { "data": { "type": "object", "required": [ "business_id", "type", "id", "properties" ], "properties": { "business_id": { "type": "string", "description": "Xendit's Business ID" }, "type": { "type": "string", "description": "Type of response, always \"payment\"", "enum": [ "payment" ] }, "id": { "type": "string", "description": "Unique payment transaction ID" }, "properties": { "type": "object", "required": [ "reference_id", "product_id", "customer_number", "admin_amount", "base_amount", "total_amount", "currency", "status", "fulfilled_at", "customer_details", "product_details", "bill_details", "payment_details" ], "properties": { "reference_id": { "type": "string", "description": "Partner's transaction reference" }, "product_id": { "type": "string", "description": "Product identifier" }, "customer_number": { "type": "string", "description": "Customer's account/service number" }, "admin_amount": { "type": "number", "description": "Administrative fee amount" }, "base_amount": { "type": "number", "description": "Base product amount" }, "total_amount": { "type": "number", "description": "Total amount including admin fee" }, "currency": { "type": "string", "description": "Currency of the product" }, "status": { "type": "string", "description": "Payment status", "enum": [ "PENDING", "SUCCEEDED", "FAILED" ] }, "fulfilled_at": { "type": "string", "format": "date-time", "nullable": true, "description": "ISO8601 timestamp when payment completed (null when pending)" }, "failure_code": { "type": "string", "nullable": true, "description": "Error code in case of FAILED status" }, "failure_reason": { "type": "string", "nullable": true, "description": "Error message in case of FAILED status" }, "customer_details": { "type": "array", "description": "Array of customer information key-value pairs", "items": { "$ref": "#/components/schemas/BillPaymentDetailKeyValue" } }, "product_details": { "type": "array", "description": "Array of product information key-value pairs", "items": { "$ref": "#/components/schemas/BillPaymentDetailKeyValue" } }, "bill_details": { "type": "array", "description": "Array of billing information key-value pairs", "items": { "$ref": "#/components/schemas/BillPaymentDetailKeyValue" } }, "payment_details": { "type": "array", "description": "Array of payment information key-value pairs", "items": { "$ref": "#/components/schemas/BillPaymentDetailKeyValue" } } } } } } } }, "BillPaymentDetailKeyValue": { "type": "object", "required": [ "key", "value" ], "properties": { "key": { "type": "string", "description": "Name of the detail field" }, "value": { "type": "string", "description": "Value of the detail field" } } }, "Error400Schema": { "type": "object", "required": [ "error_code", "message" ], "properties": { "error_code": { "type": "string", "enum": [ "API_VALIDATION_ERROR", "FEATURE_NOT_AVAILABLE" ] }, "message": { "type": "string" }, "errors": { "$ref": "#/components/schemas/XenditArrayOfErrors" } } }, "Error403Schema": { "type": "object", "required": [ "error_code", "message" ], "properties": { "error_code": { "type": "string", "enum": [ "RATE_LIMIT_EXCEEDED" ] }, "message": { "type": "string" }, "errors": { "$ref": "#/components/schemas/XenditArrayOfErrors" } } }, "Error409Schema": { "type": "object", "required": [ "error_code", "message" ], "properties": { "error_code": { "type": "string", "enum": [ "DUPLICATE_ERROR", "IDEMPOTENCY_ERROR" ] }, "message": { "type": "string" }, "errors": { "$ref": "#/components/schemas/XenditArrayOfErrors" } } }, "XenditArrayOfErrors": { "nullable": true, "type": "array", "items": { "oneOf": [ { "type": "string" }, { "type": "object" } ] } } }, "responses": { "ErrorStatusCode400Response": { "description": "Inputs are failing validation. The errors field contains details about which fields are violating validation.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error400Schema" } } } }, "ErrorStatusCode402Response": { "description": "Payment Required - Insufficient balance", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error400Schema" } } } }, "ErrorStatusCode404Response": { "description": "The provided `id` does not exist. Please review the `id` and try again", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error403Schema" } } } }, "ErrorStatusCode409Response": { "description": "Conflict", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error409Schema" } } } }, "ErrorStatusCode502Response": { "description": "Bad Gateway - Biller error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error400Schema" } } } }, "ErrorStatusCode503Response": { "description": "Service Unavailable - Biller maintenance", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error400Schema" } } } }, "ErrorStatusCode504Response": { "description": "Gateway Timeout - Biller timeout", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error400Schema" } } } } }, "securitySchemes": { "BasicAuth": { "type": "http", "scheme": "Basic" } } } } ````