Skip to content

Create payment order

To create a payment order, use this endpoint.

POST https://[base_url]/v2/apms/cash

Body

Request using the POST method, this endpoint generates a payment order

{
    "order": {
        "ref_name": "Jhon",
        "ref_lastname": "Doe",
        "ref_number": "123456789",
        "detail": "Booking payment Hotel ABC",
        "amount": 123000,
        "tax_percent": 0,
        "service_percent": 0,
        "hotel_id": 103,
        "email": "[email protected]",
        "fiscal_number": "123456789",
        "phone": "3012105687",
        "ip": "181.204.153.195"
    },
    "cash": {
        "address": "My address",
        "user_type": "N",
        "fiscal_number_type": "CC",
        "payment_type": "daviplata",
        "response_url": "https://mywebpage/payment/response"
    }
}

Body parameters

PARAMETER TYPE REQ. DESCRIPTION
order.ref_name String Yes Guest's name
order.ref_lastname String Yes Guest's lastname
order.ref_number String Yes Reservation number
order.detail String Yes Additional notes
order.amount Float Yes Amount to be charged in COP
order.tax_percent Float No Tax rate to apply to this payment. Format: Decimal with two fraction digits, the value must be between 0.00 and 1.00.
order.service_percent Float No Service charge rate to apply to this payment. Format: Decimal with two fraction digits, the value must be between 0.00 and 1.00.
order.hotel_id Integer Yes Hotel ID associated with the reservation. Refer to 5. List Hotels
order.email String Yes Buyer's email address
order.fiscal_number String Yes Buyer's document number
order.phone String Yes Buyer's phone number
order.ip String Yes Buyer's IPv4
cash.address String Yes Buye's address
cash.user_type String Yes Person type. We expect a "code" that can be obtained in endpoint 6.2.3. List Person Types
cash.fiscal_number_type String Yes Document type. We expect a "code" selected in one of the endpoints 6.2.4. List Document Types for Natural Persons or 6.2.5. List Document Types for Legal Entities
cash.payment_type String Yes "code" from the selected cash payment method
cash.response_url String Yes Customer destination, once the payment is completed. We recommend that a query be made at this URL to show the customer the final status of the transaction.

Endpoint response

{
    "transaction_id": "453593318",
    "apm_detail_id": 75,
    "checkout_url": "https://cdn-int.safecharge.com/safecharge_resources/v1/validation-code-72309.html?notifyUrl=https%3A%2F%2Ftest.safecharge.com%2FAPMNotificationGateway%2FApmConnector%2F4A794564356542B65429BD5DBBD1E0DF&locale=en_CO"
}