All critical Paylias POST, PUT, PATCH and DELETE APIs require idempotency to safely allow you to make identical requests multiple times in the event of network failures or timeouts. In order to make a request idempotent, you must pass in an Idempotency-Key header with a unique value identifying that request. Read (i.e. GET) requests must not have an Idempotency-Key included as they are naturally idempotent. For 24 hours following the initial request, as long as subsequent requests contain the same Idempotency-Key value, we will guarantee that you can safely make the same request multiple times without any side effects. For example, if a request to create a Customer or a Payment object fails, you can retry with the same idempotency key to ensure that no more than one object is created. After 24 hours, you will receive a 422 when attempting to make an identical request with a previously used idempotency key for the next 24 hours. After 48 hours, the idempotency key will be pruned from our system and a new request will be generated if the same key is used. We recommend using a UUID generator in your language to create the idempotency key, store it in your database system, and then use it when calling out to Paylias.

Example

Create a payment
curl --request POST \
     --url https://sandbox.paylias.xyz/gateway/api/v1/csp/payments \
     --header 'accept: application/json' \
     --header 'content-type: application/json' \
     --header 'x-paylias-api-key: <API-KEY>' \
     --header 'x-org-id: <Org-ID>' \
     --header 'x-partner-id: <Partner-ID>' \
     --header 'idempotency-key: <uuid>' \
     --data '
{
  "payment_id": "cjes76vsemvj3obsnc52",
  "amount": {
    "currency": "USD",
    "total": "10000"
  },
  "beneficiary_party": {
    "payment_address": "john@example.com",
    "first_name": "John",
    "last_name": "Doe",
    "email": "john@example.com",
    "phone": "+1234567890",
    "type": "Payee_Individual",
    "billing": {
      "country": "US"
    }
  },
  "debtor_party": {
    "payment_address": "jane@example.com",
    "first_name": "Jane",
    "last_name": "Smith",
    "email": "jane@example.com",
    "phone": "+1987654321",
    "type": "Payer_Individual",
    "billing": {
      "country": "US"
    }
  },
  "reference": "INV001",
  "payment_type": "Type_Pull"
}
'