Use our gateway

A merchant can use our gateway to take repeat payments from their customers. To set up repeat payments from a customer, a merchant must complete the following steps:

  1. Create a payment plan.
  2. Save the customer’s details.
  3. Use a subscription to assign the customer to the payment plan.
  4. Take the payments.

A payment plan is a template that describes how the merchant takes payments from their customers, including the following information:

  • Number of payments
  • Length of the payment plan
  • Amount for each payment
  • How often payments are taken
  • Initial costs
  • Whether to automatically collect payments or manually collect payments

A merchant can create multiple payment plans and assign multiple customers to each plan. For example, if the merchant wants to allow customers to pay in weekly installments or in monthly installments, the merchant creates a payment plan for each installment schedule. The merchant can then offer customers a choice of payment plans, and then use subscriptions to assign customers to the plans that they choose.

If the merchant chooses to automatically collect payments, our gateway collects payments from each customer. If the merchant chooses to manually collect payments, they need to use their POS to collect the payments.

Integration steps

To use our gateway to take regular payments, integrate with the following:

Step 1. Create a payment plan.
Step 2. Create a secure token.
Step 3. Create a subscription.
Step 4. (Optional) Manually collect a payment from the customer.

Before you begin

Bearer tokens

Use our Identity Service to generate a Bearer token to include in the header of your requests. To generate a Bearer token, complete the following steps:

  1. Include your API key in the x-api-key parameter in the header of a POST request.
  2. Send your request to https://identity.payroc.com/authorize.

Note: You need to generate a new Bearer token before the previous Bearer token expires.

Example request

$curl --location --request POST 'https://identity.payroc.com/authorize' --header 'x-api-key: <api key>'

If your request is successful, we return a response that contains your Bearer token, information about its scope, and when it expires.

Example response

1{
2 "access_token": "eyJhbGc....adQssw5c",
3 "expires_in": 3600,
4 "scope": "service_a service_b",
5 "token_type": "Bearer"
6}

Headers

To create the header of each POST request, you must include the following parameters:

  • Content-Type: Include application/json as the value for this parameter.
  • Authorization: Include your Bearer token in this parameter.
  • Idempotency-Key: Include a UUID v4 to make the request idempotent.
$curl
>-H "Content-Type: application/json"
>-H "Authorization: <Bearer token>"
>-H "Idempotency-Key: <UUID v4>"

Errors

If your request is unsuccessful, we return an error. For more information about errors, see Errors.

Step 1. Create a payment plan

To create a payment plan, send a POST request to our Payment Plans endpoint:

Note: To allow merchants to add their own information to the payment plan, use custom fields. For more information about how to add custom fields, go to Add custom fields to your integration.

Request parameters

To create the body of your request, use the following parameters:

Request

paymentPlanIdstringRequired>=1 character<=48 characters
Unique identifier that the merchant assigns to the payment plan.
namestringRequired>=5 characters<=128 characters
Name of the payment plan.
currencyenumRequired
Currency of the transaction. The value for the currency follows the [ISO 4217](https://www.iso.org/iso-4217-currency-codes.html) standard.
typeenumRequired
Indicates how the merchant takes the payment from the customer's account. - `manual` - The merchant manually collects payments from the customer. - `automatic` - The terminal automatically collects payments from the customer.
Allowed values:
frequencyenumRequired
Indicates how often the merchant or the terminal collects a payment from the customer.
Allowed values:
onUpdateenumRequired
Indicates whether any changes that the merchant makes to the payment plan apply to existing subscriptions. - `update` - Changes apply to existing subscriptions. - `continue` - Changes don't apply to existing subscriptions.
Allowed values:
onDeleteenumRequired
Indicates what happens to existing subscriptions if the merchant deletes the payment plan. - `complete` - Stops existing subscriptions. - `continue` - Continues existing subscriptions.
Allowed values:
processingTerminalIdstringOptional>=4 characters<=50 characters
Unique identifier of the terminal that the payment plan is assigned to.
descriptionstringOptional>=0 characters<=128 characters
Description of the payment plan.
setupOrderobjectOptional
Object that contains information about the initial cost that a customer pays to set up the subscription.
recurringOrderobjectOptional
Object that contains information about the cost of each payment. **Note:** Send this object only if the value for **type** is `automatic`.
lengthintegerOptional>=0Defaults to 0
Object that contains information about the cost of each payment. To indicate that the payment plan should run indefinitely, send a value of `0`.
customFieldNameslist of stringsOptional
Array of custom fields that you can use in subscriptions linked to the payment plan.

Example request

POST
/v1/processing-terminals/:processingTerminalId/payment-plans
1curl -X POST https://api.payroc.com/v1/processing-terminals/ \
2 -H "Idempotency-Key: 8e03978e-40d5-43e8-bc93-6894a57f9324" \
3 -H "Authorization: Bearer <token>" \
4 -H "Content-Type: application/json" \
5 -d '{
6 "paymentPlanId": "PlanRef8765",
7 "name": "Premium Club",
8 "currency": "AED",
9 "type": "automatic",
10 "frequency": "weekly",
11 "onUpdate": "continue",
12 "onDelete": "complete"
13}'

Response fields

If your request is successful, we create the payment plan and return a response. The response contains the following fields:

Response

paymentPlanIdstringRequired>=1 character<=48 characters
Unique identifier that the merchant assigns to the payment plan.
namestringRequired>=5 characters<=128 characters
Name of the payment plan.
currencyenumRequired
Currency of the transaction. The value for the currency follows the [ISO 4217](https://www.iso.org/iso-4217-currency-codes.html) standard.
typeenumRequired
Indicates how the merchant takes the payment from the customer's account. - `manual` - The merchant manually collects payments from the customer. - `automatic` - The terminal automatically collects payments from the customer.
Allowed values:
frequencyenumRequired
Indicates how often the merchant or the terminal collects a payment from the customer.
Allowed values:
onUpdateenumRequired
Indicates whether any changes that the merchant makes to the payment plan apply to existing subscriptions. - `update` - Changes apply to existing subscriptions. - `continue` - Changes don't apply to existing subscriptions.
Allowed values:
onDeleteenumRequired
Indicates what happens to existing subscriptions if the merchant deletes the payment plan. - `complete` - Stops existing subscriptions. - `continue` - Continues existing subscriptions.
Allowed values:
processingTerminalIdstringOptional>=4 characters<=50 characters
Unique identifier of the terminal that the payment plan is assigned to.
descriptionstringOptional>=0 characters<=128 characters
Description of the payment plan.
setupOrderobjectOptional
Object that contains information about the initial cost that a customer pays to set up the subscription.
recurringOrderobjectOptional
Object that contains information about the cost of each payment. **Note:** Send this object only if the value for **type** is `automatic`.
lengthintegerOptional>=0Defaults to 0
Object that contains information about the cost of each payment. To indicate that the payment plan should run indefinitely, send a value of `0`.
customFieldNameslist of stringsOptional
Array of custom fields that you can use in subscriptions linked to the payment plan.

Example response

Response
1{
2 "paymentPlanId": "PlanRef8765",
3 "name": "Premium Club",
4 "currency": "USD",
5 "type": "automatic",
6 "frequency": "monthly",
7 "onUpdate": "continue",
8 "onDelete": "complete",
9 "processingTerminalId": "1234001",
10 "description": "Monthly Premium Club subscription",
11 "setupOrder": {
12 "amount": 4999,
13 "description": "Initial setup fee for Premium Club subscription",
14 "breakdown": {
15 "subtotal": 4347,
16 "taxes": [
17 {
18 "name": "Sales Tax",
19 "rate": 5
20 }
21 ]
22 }
23 },
24 "recurringOrder": {
25 "amount": 4999,
26 "description": "Monthly Premium Club subscription",
27 "breakdown": {
28 "subtotal": 4347,
29 "taxes": [
30 {
31 "name": "Sales Tax",
32 "rate": 5
33 }
34 ]
35 }
36 },
37 "length": 12,
38 "customFieldNames": [
39 "yourCustomField"
40 ]
41}

Step 2. Create a secure token

Before you can assign a customer to a payment plan, save their payment details and create a secure token.

To save the customer’s payment details, send a POST request to our Secure Tokens endpoint.

Note: We assign the secure token to the terminal that sent the request. Depending on the merchant’s account settings, other terminals within the merchant’s account can also use the secure token.

Request parameters

To create the body of your request, use the following parameters:

Request

sourceobjectRequired
Object that contains information about the payment method to tokenize.
secureTokenIdstringOptional>=1 character<=200 characters
Unique identifier that the merchant created for the secure token that represents the customer's payment details. If the merchant doesn't create a secureTokenId, the gateway generates one and returns it in the response.
operatorstringOptional>=1 character<=50 characters
Operator who saved the customer's payment details.
mitAgreementenumOptional
Indicates how the merchant can use the customer's card details, as agreed by the customer: - `unscheduled` - Transactions for a fixed or variable amount that are run at a certain pre-defined event. - `recurring` - Transactions for a fixed amount that are run at regular intervals, for example, monthly. Recurring transactions don't have a fixed duration and run until the customer cancels the agreement. - `installment` - Transactions for a fixed amount that are run at regular intervals, for example, monthly. Installment transactions have a fixed duration.
Allowed values:
customerobjectOptional
Customer contact and address details.
ipAddressobjectOptional
Object that contains information about the IP address of the device that sent the request.
threeDSecureobjectOptional
Object that contains information for an authentication check on the customer's payment details using the 3-D Secure protocol.
customFieldslist of objectsOptional
Array of customField objects.

Example request

POST
/v1/processing-terminals/:processingTerminalId/secure-tokens
1curl -X POST https://api.payroc.com/v1/processing-terminals/ \
2 -H "Idempotency-Key: 8e03978e-40d5-43e8-bc93-6894a57f9324" \
3 -H "Authorization: Bearer <token>" \
4 -H "Content-Type: application/json" \
5 -d '{
6 "source": {
7 "type": "ach",
8 "nameOnAccount": "Shara Hazel Hopper",
9 "accountNumber": "1234567890",
10 "routingNumber": "123456789"
11 }
12}'

Response fields

If your request is successful, we store the customer’s payment details and return a response. The response contains the following fields:

Response

secureTokenIdstringRequired>=0 characters<=200 characters
Unique identifier that the merchant created for the secure token that represents the customer's payment details.
processingTerminalIdstringRequired>=4 characters<=50 characters
Unique identifier that we assigned to the terminal.
sourceobjectRequired
Object that contains information about the payment method that we tokenized.
tokenstringRequired>=12 characters<=19 characters
Token that the merchant can use in future transactions to represent the customer's payment details. The token: - Begins with the six-digit identification number **296753**. - Contains up to 12 digits. - Contains a single check digit that we calculate using the Luhn algorithm.
statusenumRequired
Status of the customer's bank account. The processor performs a security check on the customer's bank account and returns the status of the account. **Note:** Depending on the merchant's account settings, this feature may be unavailable.
mitAgreementenumOptional
Indicates how the merchant can use the customer's card details, as agreed by the customer: - `unscheduled` - Transactions for a fixed or variable amount that are run at a certain pre-defined event. - `recurring` - Transactions for a fixed amount that are run at regular intervals, for example, monthly. Recurring transactions don't have a fixed duration and run until the customer cancels the agreement. - `installment` - Transactions for a fixed amount that are run at regular intervals, for example, monthly. Installment transactions have a fixed duration.
Allowed values:
customerobjectOptional
Customer contact and address details.
customFieldslist of objectsOptional
Array of customField objects.

Example response

Response
1{
2 "secureTokenId": "MREF_abc1de23-f4a5-6789-bcd0-12e345678901fa",
3 "processingTerminalId": "1234001",
4 "source": {
5 "type": "card",
6 "cardholderName": "Sarah Hazel Hopper",
7 "cardNumber": "453985******7062",
8 "expiryDate": "1225"
9 },
10 "token": "296753123456",
11 "status": "notValidated",
12 "mitAgreement": "unscheduled",
13 "customer": {
14 "firstName": "Sarah",
15 "lastName": "Hopper",
16 "dateOfBirth": "1990-07-15",
17 "referenceNumber": "Customer-12",
18 "billingAddress": {
19 "address1": "1 Example Ave.",
20 "city": "Chicago",
21 "state": "Illinois",
22 "country": "US",
23 "postalCode": "60056",
24 "address2": "Example Address Line 2",
25 "address3": "Example Address Line 3"
26 },
27 "shippingAddress": {
28 "recipientName": "Sarah Hopper",
29 "address": {
30 "address1": "1 Example Ave.",
31 "city": "Chicago",
32 "state": "Illinois",
33 "country": "US",
34 "postalCode": "60056",
35 "address2": "Example Address Line 2",
36 "address3": "Example Address Line 3"
37 }
38 },
39 "contactMethods": [
40 {
41 "type": "email",
42 "value": "[email protected]"
43 }
44 ],
45 "notificationLanguage": "en"
46 },
47 "customFields": [
48 {
49 "name": "yourCustomField",
50 "value": "abc123"
51 }
52 ]
53}

Step 3. Create a subscription

To assign a customer to a payment plan, send a POST request to our Subscriptions endpoint. You can also use this request to personalize the payment plan for each customer, for example, provide a discount on each payment or add a one-off setup fee.

Request parameters

To create the body of your request, use the following parameters:

Request

subscriptionIdstringRequired>=1 character<=48 characters
Unique identifier that the merchant assigned to the subscription.
paymentPlanIdstringRequired>=1 character<=48 characters
Unique identifier that the merchant assigned to the payment plan.
paymentMethodobjectRequired
Object that contains information about the customer's payment details.
startDatestringRequiredformat: "date"
Format: **YYYY-MM-DD** Subscription's start date.
namestringOptional>=5 characters<=128 characters
Name of the subscription. This value replaces the name inherited from the payment plan.
descriptionstringOptional>=1 character<=128 characters
Description of the subscription. This value replaces the description inherited from the payment plan.
setupOrderobjectOptional
Object that contains information about the initial cost that a customer pays to set up the subscription.
recurringOrderobjectOptional
Object that contains information about the cost of each payment. **Note:** Send this object only if the value for **type** is `automatic`.
endDatestringOptionalformat: "date"
Format: **YYYY-MM-DD** Subscription's end date. **Note:** If you provide values for both **length** and **endDate**, our gateway uses the value for **endDate** to determine when the subscription should end.
lengthintegerOptional>=0
Total number of billing cycles. To indicate that the subscription should run indefinitely, send a value of `0`. This value replaces the **length** inherited from the payment plan. **Note:** If you provide values for both **length** and **endDate**, our gateway uses the value for **endDate** to determine when the subscription should end.
pauseCollectionForintegerOptional
Number of billing cycles that the merchant wants to pause payments for. For example, if the merchant wants to offer a free trial period.
customFieldslist of objectsOptional
Array of customField objects.

Example request

POST
/v1/processing-terminals/:processingTerminalId/subscriptions
1curl -X POST https://api.payroc.com/v1/processing-terminals/ \
2 -H "Idempotency-Key: 8e03978e-40d5-43e8-bc93-6894a57f9324" \
3 -H "Authorization: Bearer <token>" \
4 -H "Content-Type: application/json" \
5 -d '{
6 "subscriptionId": "SubRef7654",
7 "paymentPlanId": "PlanRef8765",
8 "paymentMethod": {
9 "type": "secureToken",
10 "token": "1234567890123456789"
11 },
12 "startDate": "2024-05-02"
13}'

Response fields

If your request is successful, we assign the customer to the payment plan and return a response. The response contains the following fields:

Response

subscriptionIdstringRequired>=1 character<=48 characters
Unique identifier that the merchant assigned to the subscription.
processingTerminalIdstringRequired>=4 characters<=50 characters
Unique identifier of the terminal that the subscription is linked to.
paymentPlanobjectRequired
secureTokenobjectRequired
Object that contains information about the secure token.
namestringRequired>=5 characters<=128 characters
Name of the subscription.
currencyenumRequired
Currency of the transaction. The value for the currency follows the [ISO 4217](https://www.iso.org/iso-4217-currency-codes.html) standard.
currentStateobjectRequired
A snapshot of the subscription's current state.
startDatestringRequiredformat: "date"
Format: **YYYY-MM-DD** Subscription's start date.
typeenumRequired
How the merchant takes the payment from the customer’s account. - `manual` – The merchant manually collects payments from the customer. - `automatic` – The terminal automatically collects payments from the customer.
Allowed values:
frequencyenumRequired
Indicates how often the merchant or the terminal collects a payment from the customer.
Allowed values:
descriptionstringOptional>=1 character<=128 characters
Description of the subscription.
setupOrderobjectOptional
Object that contains information about the initial cost that a customer pays to set up the subscription.
recurringOrderobjectOptional
Object that contains information about the cost of each payment. **Note:** Send this object only if the value for **type** is `automatic`.
endDatestringOptionalformat: "date"
Format: **YYYY-MM-DD** Subscription's end date. **Note:** If you provide values for both **length** and **endDate**, our gateway uses the value for **endDate** to determine when the subscription should end.
lengthintegerOptional>=0
Total number of billing cycles. To indicate that the subscription should run indefinitely, send a value of `0`. This value replaces the **length** inherited from the payment plan. **Note:** If you provide values for both **length** and **endDate**, our gateway uses the value for **endDate** to determine when the subscription should end.
pauseCollectionForintegerOptional>=0
Number of billing cycles that the merchant wants to pause payments for. For example, if the merchant wants to offer a free trial period.
customFieldslist of objectsOptional
Array of customField objects.

Example response

Response
1{
2 "subscriptionId": "SubRef7654",
3 "processingTerminalId": "1234001",
4 "paymentPlan": {
5 "paymentPlanId": "PlanRef8765",
6 "name": "Monthly Premium Club subscription",
7 "link": {
8 "rel": "self",
9 "method": "GET",
10 "href": "https://api.payroc.com/v1/processing-terminals/1234001/payment-plans/PlanRef8765"
11 }
12 },
13 "secureToken": {
14 "secureTokenId": "MREF_abc1de23-f4a5-6789-bcd0-12e345678901fa",
15 "customerName": "Sarah Hazel Hopper",
16 "token": "296753123456",
17 "status": "notValidated",
18 "link": {
19 "rel": "self",
20 "method": "GET",
21 "href": "https://api.payroc.com/v1/processing-terminals/1234001/secure-tokens/MREF_abc1de23-f4a5-6789-bcd0-12e345678901fa"
22 }
23 },
24 "name": "Premium Club",
25 "currency": "USD",
26 "currentState": {
27 "status": "active",
28 "paidInvoices": 0,
29 "nextDueDate": "2024-08-02",
30 "outstandingInvoices": 3
31 },
32 "startDate": "2024-07-02",
33 "type": "automatic",
34 "frequency": "monthly",
35 "description": "Premium Club subscription",
36 "setupOrder": {
37 "orderId": "OrderRef6543",
38 "amount": 4999,
39 "description": "Initial setup fee for Premium Club subscription",
40 "breakdown": {
41 "subtotal": 4347,
42 "taxes": [
43 {
44 "name": "Sales Tax",
45 "rate": 5
46 }
47 ],
48 "surcharge": {
49 "amount": 217,
50 "percentage": 5
51 }
52 }
53 },
54 "recurringOrder": {
55 "amount": 4999,
56 "description": "Premium Club subscription",
57 "breakdown": {
58 "subtotal": 4347,
59 "taxes": [
60 {
61 "name": "Sales Tax",
62 "rate": 5
63 }
64 ],
65 "surcharge": {
66 "amount": 217,
67 "percentage": 5
68 }
69 }
70 },
71 "endDate": "2025-07-01",
72 "length": 12,
73 "pauseCollectionFor": 0,
74 "customFields": [
75 {
76 "name": "yourCustomField",
77 "value": "abc123"
78 }
79 ]
80}

Step 4. (Optional) Manually collect a payment

The merchant can choose to let our gateway automatically collect payments, or the merchant can manually collect payments. If the merchant chooses to manually collect payments, you must send a request every time the merchant wants to collect a payment from the customer.

To manually collect a payment from a customer, send a POST request to the Subscriptions endpoint.

Request parameters

To create the body of your request, use the following parameters:

Request

orderobjectRequired
Object that contains information about the initial cost that a customer pays to set up the subscription.
operatorstringOptional>=0 characters<=50 characters
Operator who initiated the request.
customFieldslist of objectsOptional
Array of customField objects.

Example request

POST
/v1/processing-terminals/:processingTerminalId/subscriptions/:subscriptionId/pay
1curl -X POST https://api.payroc.com/v1/processing-terminals/ \
2 -H "Idempotency-Key: 8e03978e-40d5-43e8-bc93-6894a57f9324" \
3 -H "Authorization: Bearer <token>" \
4 -H "Content-Type: application/json" \
5 -d '{
6 "order": {}
7}'

Response fields

If your request is successful, we take the payment from the customer and return a response. The response contains the following fields:

Response

subscriptionIdstringRequired
Unique identifier that the merchant assigned to the subscription.
processingTerminalIdstringRequired
Unique identifier of the terminal that the subscription is linked to.
paymentobjectRequired
Object that contains information about a payment.
secureTokenobjectRequired
Object that contains information about the secure token.
currentStateobjectRequired
A snapshot of the subscription's current state.
customFieldslist of objectsOptional
Array of customField objects.

Example response

Response
1{
2 "subscriptionId": "SubRef7654",
3 "processingTerminalId": "1234001",
4 "payment": {
5 "paymentId": "M2MJOG6O2Y",
6 "dateTime": "2024-07-02T15:30:00Z",
7 "currency": "USD",
8 "amount": 4999,
9 "status": "ready",
10 "responseCode": "A",
11 "responseMessage": "Transaction approved",
12 "link": {
13 "rel": "self",
14 "method": "GET",
15 "href": "https://api.payroc.com/v1/bank-transfer-payments/M2MJOG6O2Y"
16 }
17 },
18 "secureToken": {
19 "secureTokenId": "MREF_abc1de23-f4a5-6789-bcd0-12e345678901fa",
20 "customerName": "Sarah Hazel Hopper",
21 "token": "296753123456",
22 "status": "notValidated",
23 "link": {
24 "rel": "self",
25 "method": "GET",
26 "href": "https://api.payroc.com/v1/processing-terminals/1234001/secure-tokens/MREF_abc1de23-f4a5-6789-bcd0-12e345678901fa"
27 }
28 },
29 "currentState": {
30 "status": "active",
31 "paidInvoices": 1,
32 "nextDueDate": "2024-08-02",
33 "outstandingInvoices": 2
34 },
35 "customFields": [
36 {
37 "name": "yourCustomField",
38 "value": "abc123"
39 }
40 ]
41}

Test cases

Before you run test cases, read the Payments page in Test Your Integration.

Create a payment plan

Send a POST request to the following endpoint:

POST https://api.uat.payroc.com/v1/processing-terminals/{processingTerminalId}/payment-plans

Example response

1{
2 "paymentPlanId": "PaymentPlanTest",
3 "processingTerminalId": "3204001",
4 "name": "Davi Crisostomo",
5 "description": "Payment Plan creation",
6 "currency": "USD",
7 "setupOrder": {
8 "amount": 11000,
9 "description": "Setup Amount"
10 },
11 "length": 24,
12 "type": "manual",
13 "frequency": "monthly",
14 "onUpdate": "update",
15 "onDelete": "complete"
16}

Create a secure token

Send a POST request to the following endpoint:

POST https://api.uat.payroc.com/v1/processing-terminals/{processingTerminalId}/secure-tokens

Example response

1{
2 "secureTokenId": "MREF_1a93f3a6-9029-419f-9e87-3e2db6f0ae85uA",
3 "processingTerminalId": "3204001",
4 "source": {
5 "type": "card",
6 "cardholderName": "",
7 "cardNumber": "444433******1111",
8 "expiryDate": "1226"
9 },
10 "token": "2967538502417872",
11 "status": "cvv_validated"
12}

Create a subscription for a payment plan

Send a POST request to the following endpoint:

POST https://api.uat.payroc.com/v1/processing-terminals/{processingTerminalId}/subscriptions

Example response

1{
2 "subscriptionId": "SubTest",
3 "processingTerminalId": "3204001",
4 "paymentPlan": {
5 "paymentPlanId": "PaymentPlanTest",
6 "name": "Davi Crisostomo",
7 "link": {
8 "rel": "self",
9 "method": "GET",
10 "href": "https://api.uat.payroc.com/v1/processing-terminals/3204001/payment-plans/PaymentPlanTest"
11 }
12 },
13 "secureToken": {
14 "secureTokenId": "MREF_1a93f3a6-9029-419f-9e87-3e2db6f0ae85uA",
15 "customerName": "",
16 "token": "2967538502417872",
17 "status": "cvv_validated",
18 "link": {
19 "rel": "self",
20 "method": "GET",
21 "href": "https://api.uat.payroc.com/v1/processing-terminals/3204001/secure-tokens/MREF_1a93f3a6-9029-419f-9e87-3e2db6f0ae85uA"
22 }
23 },
24 "name": "Davi Crisostomo",
25 "description": "Create Subscription from ICC payment",
26 "currency": "USD",
27 "setupOrder": {
28 "orderId": "TheOrderID",
29 "amount": 11000,
30 "description": "Desription of SETUPORDER"
31 },
32 "recurringOrder": {
33 "amount": 11000,
34 "description": "RECURRING Order price"
35 },
36 "currentState": {
37 "status": "active",
38 "nextDueDate": "2023-08-02",
39 "paidInvoices": 0,
40 "outstandingInvoices": 122
41 },
42 "startDate": "2023-08-02",
43 "endDate": "2025-12-02",
44 "length": 24,
45 "type": "automatic",
46 "frequency": "weekly",
47 "pauseCollectionFor": 0
48}

Manually pay a subscription

Send a POST request to the following endpoint:

POST https://api.uat.payroc.com/v1/processing-terminals/{processingTerminalId}/subscriptions/{subscriptionId}/pay

Example response

1{
2 "paymentId": "KOHM1D3EZH",
3 "processingTerminalId": "3204001",
4 "operator": "Davi Crisostomo",
5 "order": {
6 "orderId": "UniqueValueForOrderID",
7 "dateTime": "2023-06-20T20:25:57.641+01:00",
8 "description": "Subscription Payment - Manual",
9 "amount": 11000,
10 "currency": "USD"
11 },
12 "card": {
13 "type": "Visa Credit",
14 "entryMethod": "keyed",
15 "cardNumber": "444433******1111",
16 "expiryDate": "1226",
17 "secureToken": {
18 "secureTokenId": "MREF_1a93f3a6-9029-419f-9e87-3e2db6f0ae85uA",
19 "customerName": "",
20 "token": "2967538502417872",
21 "status": "cvv_validated",
22 "link": {
23 "rel": "self",
24 "method": "GET",
25 "href": "https://api.uat.payroc.com/v1/processing-terminals/3204001/secure-tokens/MREF_1a93f3a6-9029-419f-9e87-3e2db6f0ae85uA"
26 }
27 },
28 "securityChecks": {
29 "cvvResult": "M",
30 "avsResult": "Y"
31 }
32 },
33 "transactionResult": {
34 "type": "sale",
35 "status": "ready",
36 "approvalCode": "OK24225",
37 "authorizedAmount": 11000,
38 "currency": "USD",
39 "responseCode": "A",
40 "responseMessage": "OK24225",
41 "cardSchemeReferenceId": "nkMX2G7ZqPavgbYiYacQ"
42 }
43}