PrimeiroPay
Search…
PIX
PIX is a server to server only payment method to increase conversion.
Payment Types
Meaning
Success return codes
PA
Successful generation of the PIX QR-Code. The shopper can go and pay for it online or at any supported POS
000.000.000
000.100.112 (on staging)
RC
Successful payment of PIX. The payment of the PIX is asynchronous and the payment confirmation depends on when the PIX was paid by the consumer
000.000.000

Initial Request

1
//send POST to https://test.oppwa.com/v1/payments
2
//Header -H "Authorization: Bearer OGE4Mjk0MTg0ZTczNjAxMjAxNGU3OGExN2E2YTE1YjB8ZjJGRUtacXRCUA=="
3
amount=10.00
4
currency=BRL
5
paymentBrand=PIX
6
paymentType=PA
7
//API credentials
8
entityId=8a8294174ae82ada014aedfd75aa1d79
9
//API credentials end
10
//Shopper details (all mandatory)
11
customer.givenName=Gustavo
12
customer.surname=Santos
13
customer.identificationDocType=TAXSTATEMENT // Type of the identification DOC. Needed as you need to send a CPF/CNPJ
14
customer.identificationDocId=70383053102 //CPF/CNPJ number of end customer
15
//end of shopper details
16
billing.country="BR"
17
customParameters[CUSTOM_due_time]=7200 //Due time of the PIX in seconds. 7200 seconds = 2hours. You can also use customParameters[CUSTOM_due_date]=DDMMYYYY. If no expiry date is sent, will be set to 3 days by default.
18
merchantTransactionId=1234
19
shopperResultUrl=http://www.primeiropay.com //Although there is no re-direct back from PIX to your shop, our API requires this parameter to be present
20
testMode=EXTERNAL // only required on staging. Please remove on production environment
Copied!
The collection of the CPF (Tax Identification number) is mandatory for all payments in Brazil. It is also mandatory to verify the CPF via this Java Script:
https://gist.github.com/cauerego/873308 - Connect to preview

Successful Response

1
{
2
"id":"8a82944964ea186c0164ecbf445f7385",
3
"paymentType":"PA",
4
"paymentBrand":"PIX",
5
"amount":"10.00",
6
"currency":"BRL",
7
"descriptor":"Test Merchant 2460.0146.3970 Virtual Goods",
8
"merchantTransactionId":"1234",
9
"result":{
10
"code":"000.100.112",
11
"description":"Request successfully processed in 'Merchant in Connector Test Mode'"
12
},
13
"resultDetails":{
14
"ExtendedDescription":"Payment method ready to be captured",
15
"connectorId":"beb52023-ea89-4750-9a82-75525d189249",
16
"ConnectorTxID2":"1234",
17
"reconciliationId":"1234"
18
},
19
"customer":{
20
"givenName":"Gustavo",
21
"surname":"Santos",
22
"identificationDocType":"TAXSTATEMENT",
23
"identificationDocId":"70383053102"
24
},
25
"customParameters":{
26
"CUSTOM_due_time":"7200"
27
},
28
"redirect":{
29
"url":"https://pix.primeiropay.com/2313413241414",
30
"parameters":[
31
32
]
33
},
34
"buildNumber":"[email protected] 10:29:18 +0000",
35
"timestamp":"2018-07-30 19:51:58+0000",
36
"ndc":"8a8294174ae82ada014aedfd75aa1d79_dca6a0b62dc44d0e81195603af6f39a7"
37
}
Copied!

Re-directing the shopper

From the success response you will be able to extract the URL to where you re-direct the shopper to in order to display the PIX QR-code itself. Please note that the staging environment of the bank may show an error from time to time instead of the actual PIX.

Retrieve notifications when the PIX is paid

Please refer to section webhooks
1
[
2
2018-07-30
3
][
4
19:57:13,
5
046
6
]Notification b8d00c6a-276b-4816-a423-a7996e376834 message:{
7
"type":"PAYMENT",
8
"payload":{
9
"id":"8a82944a64ea2a060164ecc41d671606",
10
"referencedId":"8a82944a64ea2a060164ecc06db70bce",
11
"paymentType":"RC",
12
"amount":"10.0",
13
"currency":"BRL",
14
"presentationAmount":"10.0",
15
"presentationCurrency":"BRL",
16
"descriptor":"Test Merchant 6086.5776.5026 Virtual Goods",
17
"merchantTransactionId":"****",
18
"result":{
19
"code":"000.100.112",
20
"description":"Request successfully processed in 'Merchant in Connector Test Mode'",
21
"randomField621972632":"Please allow for new unexpected fields to be added"
22
},
23
"customer":{
24
"givenName":"Gustavo",
25
"surname":"Santos",
26
"identificationDocType":"TAXSTATEMENT",
27
"identificationDocId":"70383053102"
28
},
29
"billing":{
30
"country":"BR"
31
},
32
"authentication":{
33
"entityId":"8a8294174ae82ada014aedfd75aa1d79"
34
},
35
"customParameters":{
36
"INFO_matchingAlgorithm":"MANUAL_MATCH"
37
},
38
"redirect":{
39
"parameters":[
40
41
]
42
},
43
"risk":{
44
"score":""
45
},
46
"timestamp":"2018-07-30 19:57:12+0000",
47
"ndc":"DFCAD1AC1C0E00977B5A9FFE0E85AB3D.sbg-vm-bip01_1234_rand3cd6e14412f83147"
48
}
49
}
Copied!

Field specifications

Name
Description
Format
Example
Authorization Bearer (Header)
Authentication token used to identify the merchant.
AN [a-zA-Z0- 9_]
Bearer OGE4Mjk0MTg0ZTczNjAxMjAxNGU3OGExN2E2YTE1YjB8ZjJGRUtacXRCUA==
amount
Amount of the payment request. The dot is used as a decimal separator.
N13[0- 9]{1,10}\.[0 -9]{2}
1.00
currency
Currency Code according to ISO 4217 specifications of the payment request’s amount
A3 [a-zA-Z]{3}
BRL
paymentBrand
The brand specifies the method for the request
AN32 [a-zA-Z0- 9_] {1,32}
PIX
paymentType
The payment type for the request
A2
PA
entityId
The entity for the request. (e.g. channel)
AN32 [a-zA-Z0- 9]{32}
8a8294174ae82ada014 aedfd75aa1d79
customer.identificationDocId
CPF number of customer or CNPJ of the company
N11 or N14
50439917476
or 50966454000190
merchantTransactionID
Merchant-provided reference number
AN255 [\s\S]{1,25 5}
1234
customParameters[CUSTOM_due_time]
Optional. Due Time of the Pix in Seconds.
Will overwrite customParameters[CUSTOM_due_date] if both are sent.
N10
7200
customParameters[CUSTOM_due_date]
Optional. Due Date of PIX.
Will be set to the date you sent at 23:59:59 UTC
DDMMYYYY
{19|20}([0-9]{2})-(0[1-9]|1[0-2])-(0[1-9]|1[0-9]|2[0-9]|3[0-1])
21012022