Schedule a Payment

With Scheduling API, you can schedule DB, PA or CD transaction in the future.

How it works

1. Store the payment data

Register the customer payment information could be done from PrimeiroPay or could be done through Server-To-Server in two methods: Store the data during a payment or store it as stand alone.

Following is an example of stand alone registration.

curl https://test.oppwa.com/v1/registrations \
-d "entityId=8a8294184e736012014e78a1b1da15d3" \
-d "paymentBrand=VISA" \
-d "card.number=4200000000000000" \
-d "card.holder=Jane Jones" \
-d "card.expiryMonth=05" \
-d "card.expiryYear=2021" \
-d "card.cvv=123" \
-H "Authorization: Bearer OGE4Mjk0MTg0ZTczNjAxMjAxNGU3OGExN2E2YTE1YjB8ZjJGRUtacXRCUA=="

Try it Out

2. Schedule a payment

Send a request to /schedules end point with the registrationId, payment type and the job schedule which describes when and how often the transaction should be committed.

For complete reference of job parameters, check API Parameters Reference:

curl https://test.oppwa.com/scheduling/v1/schedules \
-d "entityId=8a8294184e736012014e78a1b1da15d3" \
-d "registrationId={registrationId}" \
-d "amount=17.00" \
-d "currency=EUR" \
-d "paymentType=DB" \
-d "job.month=*" \
-d "job.dayOfMonth=1" \
-H "Authorization: Bearer OGE4Mjk0MTg0ZTczNjAxMjAxNGU3OGExN2E2YTE1YjB8ZjJGRUtacXRCUA=="

Try it Out

3. We execute the transaction for you

As the scheduled transaction triggers, the system commits the payment transaction on time using the stored payment information and payment type specified.

The system will commit a payment transaction with the paymentType, amount and currency specified, and will use the payment information registered on the first step.

4. Cancel the schedule

As the case of canceling the scheduled transaction, merchant sends a deschedule request to cancel future transactions.

Send a request to the de-scheduling specifying the referenceId of the scheduled transaction as following:

Curl https://test.oppwa.com/scheduling/v1/schedules/{id}
-X DELETE "https://test.oppwa.com/scheduling/v1/schedules/{id}\?entityId=8a8294184e736012014e78a1b1da15d3" \
-H "Authorization: Bearer OGE4Mjk0MTg0ZTczNjAxMjAxNGU3OGExN2E2YTE1YjB8ZjJGRUtacXRCUA=="