Payment · Payments for Programmers

Payments for Programmers

Payment

200 words 1 minutes

The order payment endpoint can be used to set payment on an order. This will only be necessary when payment will be delayed, such as when mailing a checkout payment request to a customer for an already created order.

Creating

Card Token Payment

Request

POST https://api.payfunc.com/order/<order id>/payment
Authentication: Bearer <public.api.key>

{
	"number": "your order identifier",
	"items": 7.42,
	"currency": "EUR",
	"payment": {
		"type": "card",
		"card": "<card token>"
	}
}

Response - Successful order creation

eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJwYXlmdW5jIiwiaWF0IjoxNjAzMzU5Njg4LCJhdWQiOiJwcm9kdWN0aW9uIiwibnVtYmVyIjoieW91ciBvcmRlciBudW1iZXIiLCJjbGllbnQiOiJQYXlGdW5jIiwiaXRlbXMiOnsicHJpY2UiOjMwNSwic3RhdHVzIjpbIm9yZGVyZWQiXX0sImN1cnJlbmN5IjoiU0VLIiwicGF5bWVudCI6eyJ0eXBlIjoiY2FyZCIsIm1ldGhvZCI6ImxpbmsiLCJtZXNzYWdlIjoiIiwiYW1vdW50IjozMDUsImN1cnJlbmN5IjoiU0VLIiwiY3JlYXRlZCI6IjIwMjAtMTAtMjJUMDk6NDE6MjcrMDA6MDAiLCJzdGF0dXMiOiJjcmVhdGVkIiwic2VydmljZSI6ImNhcmRmdW5jIiwibGluayI6Imh0dHBzOi8vYXBpLnBheWZ1bmMuY29tL2NvL2RlbW9kZW1vL3NFUENUVTJxTzEtWFg1LUsiLCJyZWZlcmVuY2UiOiJjNTExZTA3ZC1kZWI3LTQwMGQtYjgwOS0zMDAzODdmOTAzZjMiLCJzY2hlbWUiOiJ2aXNhIiwiaWluIjoiNDExMTExIiwibGFzdDQiOiIxMTExIiwiY2FyZCI6ImV5SmhiR2NpT2lKU1V6STFOaUlzSW5SNWNDSTZJa3BYVkNKOS5leUpwYzNNaU9pSmpZWEprWm5WdVl5SXNJbWxoZENJNk1UWXdNek0xT1RZMk5ERXlPQ3dpWVhWa0lqb2ljSEp2WkhW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lkIjoic0VQQ1RVMnFPMS1YWDUtSyIsInN0YXR1cyI6WyJvcmRlcmVkIl19.T6o_YxXdr3WTOIJHABKhQuSsX3R2EIXejlObpynaXJiS73udyj5E2AfVdtrwZA7_IzzODCCYIU2mCqiOtlQN_7w4qSdAUjUzwLTEQR0sWg8nt0oeW_a0w7wyxe8tL2nBSMaRFOKAAgR6qbWUZf8j2KcAzJktNyK9vkT-PhUOeqKyBZhrS-t4uy7i4dUUenjU4H8C_gncRRERXXVSYOFch2WyjZUkdhdKAutHcxTbYN_ZnZBKFqGDxpHWZSV2NDJeRg_KD3Ro7SLvYSsUpO29rOaxrZoEcU5SnF_uiwJQ_Dn5B_hKTQWhgrq_VuOiWtUvo6u8KLEbjrFhSWlUahZQzw

Response - As JSON

{
  "number": "your order number",
  "client": "PayFunc",
  "items": {
    "price": 305,
    "status": [
      "ordered"
    ]
  },
  "currency": "SEK",
  "payment": {
    "type": "card",
    "method": "link",
    "message": "",
    "amount": 305,
    "currency": "SEK",
    "created": "2020-10-22T09:41:27+00:00",
    "status": "created",
    "service": "cardfunc",
    "link": "https://api.payfunc.com/co/demodemo/sEPCTU2qO1-XX5-K",
    "reference": "c511e07d-deb7-400d-b809-300387f903f3",
    "scheme": "visa",
    "iin": "411111",
    "last4": "1111",
    "card": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJjYXJkZnVuYyIsImlhdCI6MTYwMzM1OTY2NDEyOCwiYXVkIjoicHJvZHVjdGlvbiIsInNjaGVtZSI6InZpc2EiLCJpaW4iOiI0MTExMTEiLCJsYXN0NCI6IjExMTEiLCJleHBpcmVzIjpbMiwyMl0sInR5cGUiOiJzaW5nbGUgdXNlIiwiY2FyZCI6IkYwb0lzdDVYIiwidmVyaWZpY2F0aW9uIjp7InR5cGUiOiJwYXJlcyJ9fQ.ezVD58P5TmRq6jdUXr0XGuA-7uQIvhRZxAH9YFEXuuFk5d5-324JFpyZu_Zsana6zPMAT2atr-Ndtls3rcXj6jJQHa1xcmq2Cv51cqqwjIjIfhNI7UIm2YS8QQdb_qIdXM4HaIYwkOw20lKhKu-caiGTgC4WrBPR_Wt5p73BD64OFQRFn55aenLopbyA8nCppeGyp41upak3wrFF4wrTT0RAtMFRNkaWeS18neZffSlNTqnsvL0A0dUSdVGMzdgNRZkbtklhPxIMxz0nEYSJzZkmDpKwBoR1pLndBVTLxBClONNjDxuqGppK1KqC2ICms9_u9wLy8hCNUn_IBDl8lg",
    "expires": [
      2,
      22
    ]
  },
  "theme": "dark",
  "language": "sv",
  "customer": {
    "type": "person",
    "email": "[email protected]"
  },
  "event": [
    {
      "type": "defer",
      "date": "2020-10-22T08:42:44.242Z"
    },
    {
      "type": "order",
      "date": "2020-10-22T09:41:28.394Z"
    }
  ],
  "created": "2020-10-22T08:42:44.242Z",
  "id": "sEPCTU2qO1-XX5-K",
  "status": {
    "ordered": 305
	}
}