Initiate payment

This method allows you to initiate a payment.

POST

/invoice/:invoice_id/payment

Parametri del body

invoice_id
richiesto
The id of your invoice
payment_type
richiesto
Payment type are socgen, stripe, transfer, paypal or check
payment_information Payment type additional information are socgen, stripe

Esempi


POST /invoice/1/payments HTTP/1.1
Host: api.smsup.ch
Authorization: Bearer your.token
Content-type: application/json

{
    "invoice": {
      "payment_type": "transfer",
      "payment_information": {
        
        #For stripe payment
        "success_url": "http://url",
        "cancel_url": "http://url"

        #For socgen
        "vads_url_success": "http://url",
        "vads_url_cancel": "http://url",
        "vads_url_error": "http://url",
        "vads_url_refused": "http://url"
      }
    }
}
          
        

Formato della risposta


{
    "status": 1,
    "message": "OK",
    "invoice": {
        "invoice_id": "4",
        "payment_type": "transfer",
        "invoice_information": {
            "invoice_status": 2,
            "invoice_status_detail": "waiting_for_payment",
            "total_amount": 74.27,
            "currency": "EUR",
            "total_sms": 1000,
            "payment_information": {        //These informations depends on payment type
                "rib": "123",
                "iban": "FR123",
                "bic": "ABC",
                "bank": "My Bank"
            }
        }
    }
}