Payment

Payment processing is a crucial part of any e-commerce system. Sleekshop provides endpoints to manage payment methods and initiate payment processes. On this page, we'll explore the different payment endpoints you can use to retrieve payment methods, process payments, and manage delivery costs.


POSTget_payment_methods

Get payment methods

This endpoint allows you to retrieve all available payment methods that are activated in the backend.

Required attributes

  • Name
    licence_username
    Type
    string
    Description

    Your licence username.

  • Name
    licence_password
    Type
    string
    Description

    Your licence password.

Request

POST
get_payment_methods
curl https://demo.sleekshop.net/srv/service/ \
    -d licence_username='demo_NBSqhrcrhMci15Ir9UWI' \
    -d licence_password='s9vmrbwT23B7bmjR4Vmz' \
    -d request='get_payment_methods'

Response

{
    "object": "payment_methods",
    "PayPal": {
        "id": 1,
        "name": "PayPal",
        "attributes": {}
    },
    "PrePayment": {
        "id": 2,
        "name": "PrePayment",
        "attributes": {}
    },
    "Cash": {
        "id": 3,
        "name": "Cash",
        "attributes": {}
    },
    "EC-Cash": {
        "id": 4,
        "name": "EC-Cash",
        "attributes": {}
    },
    "Sofortueberweisung": {
        "id": 5,
        "name": "Sofortueberweisung",
        "attributes": {}
    },
    "PayMill": {
        "id": 6,
        "name": "PayMill",
        "attributes": {
            "bridge_url": "https://bridge.paymill.com/",
            "public_key": ""
        }
    },
    "Stripe": {
        "id": 7,
        "name": "Stripe",
        "attributes": {
            "public_key": ""
        }
    }
}

POSTdo_payment

Do payment

This endpoint allows you to initiate the payment process for a permanent order determined by its ID.

Required attributes

  • Name
    id_order
    Type
    integer
    Description

    The ID of the order you want to initiate the payment for.

Optional attributes

  • Name
    args
    Type
    object
    Description

    Additional arguments required by specific payment methods. You can include 'success_url' and 'cancel_url' to override the default redirect URLs set in the backend.

Request

POST
do_payment
curl https://demo.sleekshop.net/srv/service/ \
    -d licence_username='demo_NBSqhrcrhMci15Ir9UWI' \
    -d licence_password='s9vmrbwT23B7bmjR4Vmz' \
    -d request='do_payment' \
    -d id_order=1 \
    -d args="[]"

Response

{
    "object": "do_payment",
    "method": "PayPal",
    "status": "Success",
    "redirect": "https://www.paypal.com/webscr&cmd=_express-checkout&token=EC-255618719P542743Y&cmd=_express-checkout&useraction=commit",
    "token": ""
}

POSTadd_delivery_costs

Add delivery costs

This endpoint allows you to add delivery costs to the cart of a valid session.

Required attributes

  • Name
    session
    Type
    string
    Description

    A valid session ID.

  • Name
    delivery_costs
    Type
    array
    Description

    An array of delivery cost positions. Each position should be an array containing [Name, Amount, Tax].

Request

POST
add_delivery_costs
curl https://demo.sleekshop.net/srv/service/ \
    -d licence_username='demo_NBSqhrcrhMci15Ir9UWI' \
    -d licence_password='s9vmrbwT23B7bmjR4Vmz' \
    -d request='add_delivery_costs' \
    -d session='SESSION' \
    -d delivery_costs="[["Delivery",4.90,0.19],["Delivery2",5.90,0.19]]"

Response

{
    "object": "add_delivery_costs",
    "status": "SUCCESS"
}

Was this page helpful?